http://stackoverflow.com/questions/4477 ... htasks-exe
5
down vote
Please see my answer to a similar question, of how to set the "Wake the computer to run this task..." option that is only available from the Task Scheduler UI (and via the XML), and not the schtasks.exe /create command line .
The nuts and bolts of it are:
Create your task via schtasks.exe /create /tn MyTask ...
Export your task to XML via schtasks.exe /query /xml /tn MyTask > MyTask.xml
Update this XML via XSLT or a search/replace
Re-import (overwriting the old task) via schtasks.exe /create /tn MyTask /xml MyTask.xml /f
Details are here.
匯出
代碼: 選擇全部
C:\Users\yehlu>schtasks /query /xml /tn 551cron > 551cron.xml
匯入
代碼: 選擇全部
C:\Users\yehlu>schtasks /create /tn 551cron1 /xml 551cron.xml /f