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?
LVL 1
3Si_pnewmanAsked:
Who is Participating?
 
3Si_pnewmanConnect With a Mentor Author Commented:
Discovered:

Make sure that the TASK SCHEDULER service is ticked for "Allow interaction with Desktop".  Also, if any of the command lines, script being called, BAT files being utilised, etc. use Drive Mappings to network shares then these should be replaced with full UNC paths as the drive letter reference might not be resolved because the user is not logged on and therefore a NETLOGON script not executed.
0
 
MrLonandBCommented:
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?
0
 
3Si_pnewmanAuthor Commented:
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.

0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
dreamyguyCommented:
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.
0
 
philginCommented:
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.
0
 
3Si_pnewmanAuthor Commented:
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
0
 
philginCommented:
When are you planning to run the scheduled task?
0
 
dreamyguyCommented:
Is this happening on just this machine or other machines as well? This will help us determine whether the issue is BY DESIGN.
0
 
3Si_pnewmanAuthor Commented:
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.
0
 
philginCommented:
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.
0
 
philginCommented:
And then try testing the calc.exe again with the Task Scheduler.
0
 
dreamyguyCommented:
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
0
 
3Si_pnewmanAuthor Commented:
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.
0
 
dreamyguyCommented:
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)
0
 
3Si_pnewmanAuthor Commented:
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!!

0
 
dreamyguyCommented:
what user account is the job running under? what if u change it to run under the local system account?
0
 
3Si_pnewmanAuthor Commented:
the job is running under the administrator account.
0
 
dreamyguyCommented:
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?
0
 
3Si_pnewmanAuthor Commented:
i dont get any error code. just get the success code.
it just ends the job after 3 minutes and returns success.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.