I have a batch file and a corresponding task entry set up for it- and when I manually run the
.bat file, it runs just fine- but the task scheduler doesn't execute the
.bat file properly.
I believe I set up the task correctly. The "Security options" are properly set up, the trigger is accurate, and the Action has the following parameters:
Action: "Start a program"
"C:\foo\Command Line Utility\TopSecretProject\desiredscript.bat"
Add arguments (optional):
desiredscript.bat(tried with and without this)
Start in (optional):
C:\foo\Command Line Utility\TopSecretProject\(tried with and without this)
When looking at the history, I see that the task was triggered, the task engine received the message to start the task, the action was started, the task was started, the task process was created, and 36 seconds later, the action and task were completed.
However, the task normally takes about 1-2 minutes to run when the batch file runs normally; incidentally, the expected output of the batch file isn't realized.
My question: how can I troubleshoot this further? Does the very short run time tell us anything beside that something in the Task Scheduler isn't running properly?
- "Allow task to be run on demand" is checked;
- "Stop the rask if it runs longer than: " is set to 3 days
- "If the task is already running, then the following rule applies: " is set to "Do not start a new instance"
- "Run whether user is logged on or not" is checked; correct password was entered
- "Run with highest priviledges" (tried with and without this checked)