How to pass an argument of Scheduled Task properties with command line

0

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?

Ahmed Nazmy

Posted 2020-01-30T08:10:36.927

Reputation: 111

Answers

0

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

Ahmed Nazmy

Posted 2020-01-30T08:10:36.927

Reputation: 111