Windows Scheduler Issue

  • Thread starter Thread starter Mark Penfold
  • Start date Start date
M

Mark Penfold

Hi
I've a .bat file that runs fine when run interactively
logged in as a particular user.
It needs to run at a particular time every day and I've
set up the windows scheduler to run it every day and use
the run as facility to run the file as the relevant user.
This works fine as long as the server is logged in (and
locked) as the user.
If that user is logged off the server, then the job
appears to run, but actually ends with an exit code of
two. It can't be a permissions thing, as I've proved the
file/job runs ok when scheduled, as long as the user
remains logged in.
I've tried moving environment variable settings into the
batch job in case this was the issue, but it didn't help.
We obviously have a workaround - leave the server logged
in permanently - but this isn't ideal.
My guess is that the file is somehow trying to interact
with the desktop, but it is a third party piece of code so
we don't have many options.
Anyone else come across this situation before?
 
Back
Top