windows - Using schtasks from the command line, what parameter will wake the computer from sleep and execute the task -
The option is present in the UI, but not in the help displayed in the command line
Do you create a new job through the schtasks.exe
command line Are or updating existing work? Vista, schtasks.exe
is the option for both > and / create
and / query / xml
. >. With this XML encoding of the work, you can set the WakeToRun
node to wake the computer from sleep to run the job:
& Lt; Triggers / & gt; & Lt; Principals & gt; ... & lt; / Principal & gt; & Lt; Settings & gt; ... & lt; WakeToRun & gt; True & lt; / WakeToRun & gt; ... & lt; / Settings & gt; & Lt; Verb context = "author" & gt; & Lt; Exec & gt; & Lt; Command & gt; Myprogram.exe & lt; / Command & gt; & Lt; / Exec & gt; & Lt; / Action & gt; & Lt; / Tasks & gt;
If you have to make a computer-level work from the command line, then you can export the basics of the XML function, to add this code to In the Task Scheduler UI, select "wake up to run this computer to run" Right-click the job and select Create a task with the original set (action, time, etc.) through the command line. Then, export XML, programmatically add schtasks.exe / Create / tn / xml MyTask.xml / f WakeToRun , Then import this XML definition again You can do this two ways:
Export. .
for XML. You can then import this file again to another machine (see below), and wake-to-run will be set. Or, WakeToRun
node (via XSLT or search / replacement), then import this update XML again:
Comments
Post a Comment