不起作用
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
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
谢谢你:)