Windows batch file issues

JimboJet

New Member
Hi

I'm not sure if this is a Progress problem, or a Windows problem, but I'll try and see what I get anyway.

I've got a batch file which is running a progress script, and dumping out a text file, and it works fine. I'm running this on a Windows 2003 server, and I've got a service account for running scheduled tasks. Logging into the server under the service account credentials I can run the batch file with no issues.

My problem arises when I try to get the service account to run the batch file as a scheduled task. It's only working if the service account is logged into the server (and yes, I've made sure the check box about running if not logged in is set appropriately).

If the service account is logged in I can either kick off the scheduled task manually, or watch it start at a set time, and in both cases I get the output. If the service account isn't logged in, the script appears to run and terminates happily with a 0x0 code, but I get no output. In this latter case there's no sign of any activity in the database log.

Has anyone experienced anything similar, or have any bright ideas?
This is baffling me...:confused:

Thanks
James
 
OK, a bit more detail:

The batch script is running _progres.exe, and passing it the path to the pf file for the DB, and the path to the .p script to be run.

That make it any easier for anyone to help?
 
Hi,

In my opinion it is a windows problem. Maybe the service account has no rights to the output directory.

Try to create a simple progress procedure that for instance exports a message "test" to a file directly on the C-Drive.

See what happens then...
 
The service account has output rights, so that's not causing the problem. If I try to run the script with my credentials it works, but only if I'm logged into the server: running it as a scheduled task gives me output only if I'm logged into the server on which the task is set. If I'm not logged in I get no output, and a 0x2 (File not found) error on the task.

There's three possible files it's unable to find, the .p script, the .pf file and the output file. I've confirmed all of them are correct, and tried moving them to different directories, but I'm still getting the same results each time.

Baffling...
 
Have you tried a SET command at the start of the Batch File to make sure your environment variables are set up correctly?

If you have SET > c:\batchfile.log then you will be able to check that the DLC, PROMSGS and PROPATH are set up correctly.

Once you have done that then try putting some ECHO commands in the batch file to check where things go wrong.
 
i had a similar problem a view years ago (lotus notes script). I remember, that if you start the batch as a service you are not allowed to use maped devices e.g. a drive like "net use x: \\...dadada". If you use such mapped drives it will not work - at least in the past ;)
regards
horst
 
There's no UNC paths involved, I've moved it all to local drives (thought that might be an issue too, but I can rule that out).

I've got the output of the environmental variables that exist when running as a scheduled task when not logged on. There were a handful of differences, but none that looked like they should be causing any issues (with the possible exception of TEMP, TMP). Just to be sure, I've set them all in the batch file, and confirmed they're all present prior to the _progres.exe being called, but still getting the 0x2 file not found error.

And there's not much scope with any further logging. Ignoring the SET commands mentioned above I've stripped the batch file down to the following single command:
E:\Path\to\_progres.exe -b -pf E:\Path\to\db.pf -p E:\Path\to\Script.p

Thanks for the suggestions tho'.
Grrrrrr...
 
I don't know squat about windows but I have a vague recollection that I once heard something along the lines that there is some requirement that the user running a scheduled task be a "local user"?
 
All the other scheduled tasks run on this server have no issues, it's only this progress one which is problematic. Hence why I think it's Progress related.

Frustrating as hell - how hard should it be to extract some lousy data from a database using a scheduled task...
 
Just for kicks try creating a local user to run the scheduled task.

And try setting DLC, PROMSGS and PROPATH via "My Computer" too.
 
Back
Top