Server 2008 Task Scheduler and a CMD file

tasktask-scheduler

Task Scheduler – I have a .cmd file I'm trying to execute on a regular basis through Task Scheduler. I've set the task so that it points to the cmd file. I want the task to execute even when no one is logged in. I've set the credentials associated with the task to the local service account. When I execute the task, nothing happens. The Last Run Result shows 0x1, this means it didn't execute properly. When I run the file from a command prompt it executes just fine. Any help out there would be appreciated. I would post the code but it has sensitive information in it and I'm not allowed to let the code outside. Thanks

Best Answer

It's unclear from your question whether the task is running as "LOCAL SYSTEM" or a local user that's a service account.

If,

  1. the user is a local service account, not the system account, and
  2. the user is not in the Administrators group,

then you'll need to make modifications to the security settings of cmd.exe - by default, the NTFS ACL only allows Administrators and interactively logged on users to execute it. (reference)

Edit: Oh, and this is only applicable to Windows 2003. I'm up to three baseless assumptions in this answer.. let us know what OS and level of user rights and we should be able to narrow it down.