日期和时间以及计划任务

问题描述 投票:0回答:1

不起作用

echo %date% %time% schtasks /create /sc daily >> Logs.txt

记录执行的schtasks的日期和时间

Mon 05/20/2024 14:38:31.60 SUCCESS: The scheduled task sdf
Mon 05/20/2024 14:38:31.60 SUCCESS: The scheduled task sd
Mon 05/20/2024 14:38:31.60 SUCCESS: The scheduled task fse
Mon 05/20/2024 14:38:31.60 SUCCESS: The scheduled task ser
Mon 05/20/2024 14:38:31.60 SUCCESS: The scheduled task tes
Mon 05/20/2024 14:38:31.60 SUCCESS: The scheduled task 1
batch-file
1个回答
0
投票

for /F "delims=" %%I in ('schtasks /create /sc daily /tn "auto restart my computer daily" /tr "shutdown -r" /st 23:00 /f 2^>^&1') do (echo %DATE% %TIME% %%I) 1>>Logs.txt

谢谢你:)

© www.soinside.com 2019 - 2024. All rights reserved.