@echo off & %~n0 - bi202011111633
@date /t | find "六" && goto:countdown
@date /t | find "日" && goto:countdown
exit
:countdown
shutdown -s -t 60
echo shutdown in one minute, please confirm? y/n
set /p cmd=
if "%cmd%"=="n" (
shutdown -a
)
设定开机后任务计划
schtasks /create /tn "shutdown@sat&sun" /ru SYSTEM /sc ONSTART /tr "D:\weekends.bat"