Thursday, March 25, 2010

Task scheduler issues on Server 2008

Microsoft has changed the task scheduler pretty drastically since windows XP and it is very hard to get used to. I had a recent issue where I couldn’t tell if my .bat file I use for backups had really run – the bat file is supposed to write to 3 separate log files while running so I can view any problems and verify what it did. Well, the task seemed to run however, the log files were not updating. After investigating I found that the following steps should be carefully run through when creating a task in 2008:

• Make sure that the task is set to "configure for Windows Vista or Windows 2008" on the first page of the task properties (under the "general" tab)
Very important when writing to log files --> Make sure that the task is set to "start in" the folder that contains the batch file: open the task properties, click on the "actions" tab, click on the action and then the "edit" button at the bottom. In the "Edit Action" Window there is a field for "start in (optional)" that you set to the path to the batch file.
• Make sure that the task is running as an account that has explicit "Full access" permissions to all these things: The .bat file itself, the folder containing the .bat file, and the target files/folders that are affected by the .bat script.
• Make sure that the account running the task is a member of the local "administrators" group for this machine
• Make sure that the task is set to "run whether logged on or not"