Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running VFP on Windows server Task Scheduler
Message
From
28/04/2018 02:53:53
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
27/04/2018 15:14:13
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
01659602
Message ID:
01659623
Views:
77
Likes (1)
I'll insert my comments in between:

>Since you cannot see it run, log files and emails are your friends.
>Repeat: You really need to log what is going on, or you are blind!

True. While you can run the exe yourself (and then it's visible), it doesn't run in the same context from TSch - different user, different default start folder.

>Create another Windows user account so that it runs "behind the scenes" and never interferes with the desktop.
>In task scheduler, these settings work for me:
> Use your new user account
> Run whether users is logged in or not
> Run with highest privileges

Found that it's not really necessary, but depending on what it needs to do, may help.

> Hidden
>I avoid using mapped network drives - they seem to fail occasionally, I am not sure why.

Once in a blue moon the network may be unavailable or something, the drive disconnects, and doesn't automagically reconnect. It's been so since DOS days and never got really fixed.


>Your program will be started in a Windows System Folder
>I use this to change the current directory to my exe folder:
>
CD (JUSTPATH(SYS(16)))
In the TSch, there's a "Start in" textbox, where you can set the launch folder. Whichever moron wrote that dialog, forgot to add some basic validation - so, two things that you need to beware of:
- no trailing backslash!
- no quotes around it even if it contains spaces!

Or else your task will fail silently. The error messages in the event log will give you negative information (when you read them, you'll know less). Learned this the hard way.

As for the account under which the task runs, YMMV. You may run it under your own account because it has a password which never changes. The value of never may change when their admin quits in disgust and new one doesn't know why is this 'never' in there. Or something nasty may happen on their system, and they may hire some IT cops to strengthen their security (always after the fact) and they may revoke that never, without telling anyone. Their job description is to make everyone's life less pleasant and they have a vow of silence. You never know what they may do, and they never tell. So I prefer the other approach, some account with official looking name, with password which never changes, and just enough rights to run this task.

Why is this password thing important? Because when it expires, it will be changed, but it will NOT be changed in TSch, because your task runs silently and without a problem and everyone forgets about it. Two months later (sometimes four) someone will notice that the task isn't running and once they get your attention your exe better be able to deal with the backlog.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform