批次檔建立排程

MSFT相關
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

批次檔建立排程

文章 yehlu »

https://www.microsoft.com/resources/doc ... x?mfr=true

代碼: 選擇全部

SchTasks /Create /SC MINUTE /TN "551einv" /TR "C:\551einv\win\schedule.bat"
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

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

文章 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
回覆文章

回到「Microsoft」