I understand that I can create a scheduled task with command line using SCHTASKS.exe. I need to create a scheduled task that run even when windows goes in a sleep mode and I found how to do it with task scheduler GUI using task properties as follows: Task > Properties > Conditions > [Tick] Wake the computer to run this task Task > Properties > Settings > [Tick] Run task as soon as possible after a scheduled start is missed.

My command like: SCHTASKS /CREATE /SC DAILY /TN "ITTTasks\autoRestart" /TR "shutdown.exe -r -t 1" /ST 00:00 /ru "System"

My question: How to do these two options using command line?


I found it finally, the Short answer is I cannot do [Wake the computer to run this task] using schtasks.exe command line according to this link, and in this case you should switch to PowerShell Scheduler cmdlets in this link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.