0
I'm trying to schedule a batch file to run at start up. Here is my command:
schtasks /create /tn test /tr c:\simple.bat /sc onstart
simple.bat only writes the current time to a file:
time /t > now.txt
The task is created without issues, I see it when listing tasks via schtasks (it has status ready) and in the Task Scheduler Library in windows.
When running the batch file manually, everything is fine. However, when restarting, I see the batch is not running (no output file with the updated time) and when looking at the output of schtasks I see the status has changed to "Could not start":
TaskName Next Run Time Status
======================================== ====================== ===============
test N/A Could not start
Any ideas? Thanks.
Maybe missing security context? How can I script schtasks so it doesn't need a password?
– bummi – 2014-05-05T10:11:22.557Just wondering, is there a reason you need to use the task scheduler instead of the startup folder? – daraos – 2014-05-05T10:46:17.097