Task Scheduler - Resultcode 15
Can anyone tell me where I can find a list of resultcodes for CMD running under Task scheduler. A simple script fails with resultcode 15. Works fine if I run the .bat file manually. Thanks.Don C
June 3rd, 2010 3:44am

C:\>net helpmsg 15 The system cannot find the drive specified. Check the working directory and or the path to the script in the scheduled task.
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2010 4:21am

Typically the result codes are returned from the sheduled application. Not from shell or Task Scheduler. Regards, Dave Patrick .... Microsoft Certified Professional -Microsoft MVP [Windows]
June 3rd, 2010 4:44am

Check here for more information: http://support.microsoft.com/kb/308558 The Last Result column displays a completion code. You can obtain a full explanation of all Windows completion codes from MSDN, but the common codes for scheduled tasks are: 0x0: The operation completed successfully. 0x1: An incorrect function was called or an unknown function was called. 0xa: The environment is incorrect. Poor man's validation of these errors C:\>net helpmsg 0 The operation completed successfully. C:\>net helpmsg 1 Incorrect function. C:\>net helpmsg 10 i.e. 0xa in hex The environment is incorrect.
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2010 5:47am

Thanks. That was my guess as there is little to go wrong with the script. The script has just been copied from a server 2003R2 machine where it has been running under schedule for a long time. It works fine on the new 2008R2 when run directly, but not when under the scheduler. Looks like the 2008R2 scheduler environment is different to that of 2003 R2. I'll try and make the drive available within the script itself and see what happens.Don C
June 3rd, 2010 10:27am

Let's have a look at the script. Regards, Dave Patrick .... Microsoft Certified Professional -Microsoft MVP [Windows]
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2010 4:58pm

I have now put a NET USE command within the script and it works. It seems that the mapped drives (of the user that runs the task) are not being established when run under task manager. Don C
June 4th, 2010 1:11pm

I'm having this problem as well. copy /Y X:\backup\dbbackup1.bak "\\backupserver\Database Backups" copy /Y X:\backup\dbbackup2.bak ""\\backupserver\Database Backups" copy /Y X:\backup\dbbackup3.bak "\\backupserver\Database Backups" The same script runs fine on other boxes, including Server 2008. And if I run it manually then the files copy perfectly. 1. The task is running with elevated privileges 2. The user has explicit permissions to the directory 3. UAC is turned off 4. We've tried several variations of the Start In theme. Can anyone help?
Free Windows Admin Tool Kit Click here and download it now
June 30th, 2010 5:59pm

I'd try replacing X: with UNC path as in \\primaryserver Regards, Dave Patrick .... Microsoft Certified Professional -Microsoft MVP [Windows]
July 1st, 2010 5:55am

Sorry Dave, X is actually a logical drive local to the machine, not mapped. Wish it were that simple.
Free Windows Admin Tool Kit Click here and download it now
July 1st, 2010 6:52pm

Might check the logs for clues. <=2003 Scheduled Tasks|Advanced|View Log >=2008 Server Manager|Diagnostics|Event Viewer|Application Logs|Microsoft|Windows|TaskScheduler Regards, Dave Patrick .... Microsoft Certified Professional -Microsoft MVP [Windows]
July 2nd, 2010 6:04am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics