3Si_pnewman
asked on
Scheduled task does not run when logged out.
I have written a vb6 app that links to outlook and populates contacts in a public folder.
i have tested and it works when ran from the 'Run' option from the start menu.
if i schedule the exe it doesnt run. it doesnt return any errors either. it just does nothing!
it has been working for 6 months scheduled and now it has just stopped working. i havent amended the exe or the scheduled task.
can anybody help?
i have tested and it works when ran from the 'Run' option from the start menu.
if i schedule the exe it doesnt run. it doesnt return any errors either. it just does nothing!
it has been working for 6 months scheduled and now it has just stopped working. i havent amended the exe or the scheduled task.
can anybody help?
Simple question and you've probably checked, but is the task scheduled to run under a particular account and the login credentials of the account have changed recently?
ASKER
yes it is setup to run under a particular account but the credentials have not changed. i have gone through all the permission and the policies and the user has admin rights to almost everything.
what if you ask it to run under the system account?
what if you create a new scheduled task (just as a test) and allow it to run notepad using the same credentials, does that work?
can you also go to the scheduled tasks folder and then go to advanced-->view log and paste the logs here.
if you get Result: The task completed with an exit code of (0), that the operation completed successfully. in that case its not the task scheduler or the credentials that are the issue, its the task itself that's the issue. if that's the case, then begin by checking for permission related issues.
what if you create a new scheduled task (just as a test) and allow it to run notepad using the same credentials, does that work?
can you also go to the scheduled tasks folder and then go to advanced-->view log and paste the logs here.
if you get Result: The task completed with an exit code of (0), that the operation completed successfully. in that case its not the task scheduler or the credentials that are the issue, its the task itself that's the issue. if that's the case, then begin by checking for permission related issues.
Try creating a DOS batch (*.bat) file that calls/executes your program and add the Batch file to the Scheduled Task instead.
Test your batch file first if it executes your program.
And please use dos 8.3 format if possible.
Test your batch file first if it executes your program.
And please use dos 8.3 format if possible.
ASKER
thanks for your help.
ive tried the batch file method already and it runs my exe when ran manally but not when scheduled.
the scheduled also doesnt run calc.exe
ive tried the batch file method already and it runs my exe when ran manally but not when scheduled.
the scheduled also doesnt run calc.exe
When are you planning to run the scheduled task?
Is this happening on just this machine or other machines as well? This will help us determine whether the issue is BY DESIGN.
ASKER
i have tried running it during the day and at night,
it happens on two machines out of about 5 that i have it installed on.
it happens on two machines out of about 5 that i have it installed on.
Make sure Task Scheduler Service is started: By default on all Windows XP machines Scheduler service is started. To make sure please go to Control Panel->Administrative Tools->Services. Verify that the Status of the ‘Task Scheduler’ service reads ‘Started’. If it is not running then right-click it and select ‘Start’. Also please ensure that the 'Startup type' is set to 'Automatic' so that next time your computer starts this service starts automatically.
If it still doesn't work then Restart Task Scheduler from the services by right-clicking it and Clicking Restart.
If it still doesn't work then Restart Task Scheduler from the services by right-clicking it and Clicking Restart.
And then try testing the calc.exe again with the Task Scheduler.
next steps:
=========
can we have the schedlgu.txt?
What is the exit code that is logged for the failing job?
Try creating the job using the AT.EXE command
Reference:
==========
http://support.microsoft.com/kb/308558 - How to troubleshoot scheduled tasks in Windows XP and in Windows Server 2003
=========
can we have the schedlgu.txt?
What is the exit code that is logged for the failing job?
Try creating the job using the AT.EXE command
Reference:
==========
http://support.microsoft.com/kb/308558 - How to troubleshoot scheduled tasks in Windows XP and in Windows Server 2003
ASKER
the log file just shows the exe starting and then it eventually closes afer 72 hours(or whatwever i set it to).
the exit code it the success one.
the exit code it the success one.
wow this one is difficult. and you seem to be having a lot of patience as well :)
it doesnt seem to be an issue with task scheduler, and doesnt seem to look like a permissions issue either.
mmmm
is there any other info you can provide? i'll keep researching more in the interim.
have you tried runnign the task under the local system account or a different account? a local user account perhaps?
whats the version of mstask.dll on the affected machine as compared to a working machine? (just to make sure that the versions are the same)
it doesnt seem to be an issue with task scheduler, and doesnt seem to look like a permissions issue either.
mmmm
is there any other info you can provide? i'll keep researching more in the interim.
have you tried runnign the task under the local system account or a different account? a local user account perhaps?
whats the version of mstask.dll on the affected machine as compared to a working machine? (just to make sure that the versions are the same)
ASKER
Hi,
thanks for all your help so far!!
i have got somewhere with this now but not fully resolved the problem.
the problem was that i was scheduling the job on my server and connecting to the server via Remote Desktop (aka terminal services). according to microsoft if you schedule a job whilst logged in via terminal services the job doesnt run in the session it runs on the server console (i.e. when you actually sit at the server). so this has resolved this bit.
my only problem know is that it runs successfully if i sit at the server and watch it but if the server is logged off the job doesnt run!!
thanks for all your help so far!!
i have got somewhere with this now but not fully resolved the problem.
the problem was that i was scheduling the job on my server and connecting to the server via Remote Desktop (aka terminal services). according to microsoft if you schedule a job whilst logged in via terminal services the job doesnt run in the session it runs on the server console (i.e. when you actually sit at the server). so this has resolved this bit.
my only problem know is that it runs successfully if i sit at the server and watch it but if the server is logged off the job doesnt run!!
what user account is the job running under? what if u change it to run under the local system account?
ASKER
the job is running under the administrator account.
my only problem know is that it runs successfully if i sit at the server and watch it but if the server is logged off the job doesnt run!!
when you look at the schedlgu.txt log, what error code do you get?
could you paste the log here?
when you look at the schedlgu.txt log, what error code do you get?
could you paste the log here?
ASKER
i dont get any error code. just get the success code.
it just ends the job after 3 minutes and returns success.
it just ends the job after 3 minutes and returns success.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.