The script file runs fine as a scheduled task under Windows 2003/XP but it fails on Windows 2008/Vista. If you run the script manually on the command prompt on Windows 2008/Vista, it will work perfectly without a problem. It always fails when it runs as a scheduled task regardless of logon. Task Start Failed always occurs with the default error code 2147750687.
The problem spent me almost 2 months to figure out while I was busy with something else. It happened almost 8 months ago from now when everything was being moved from Windows 2003 to Windows 2008.
The followings were the scheduled task settings on Windows 2008/Vista:
- Run under the local Administrator account
- Run whether user is logged on or not
- Run with highest privileges - actually this one shouldn't be needed since it is run under the local Administrator.
- Modify all the relative paths to be fully qualified paths or absolute paths; e.g., c:\tasks\scheduled\output.txt
- Modify the script to take the directory as an argument when you run it; e.g., c:\tasks\scheduled\taskA.vbs c:\tasks\myappPath\.
In sum, checking if the problem is related to a relative path on your mystery task may save you from a million troubles.
No comments:
Post a Comment