1 頁 (共 1 頁)

批次檔建立排程

發表於 : 2017-03-19 19:40:24
yehlu
https://www.microsoft.com/resources/doc ... x?mfr=true

代碼: 選擇全部

SchTasks /Create /SC MINUTE /TN "551einv" /TR "C:\551einv\win\schedule.bat"

Re: 批次檔建立排程 XML 方式

發表於 : 2017-03-20 15:30:18
yehlu
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