在创建一个文件,并设置为文件名为xxx.bat(.bat是window的可运行脚本–就是可以用命令行直接运行)
睡眠命令:rundll32 powrprof.dll,SetSuspendState
睡眠.bat 文件编辑把上面命令复制上去即可
关机命令:Shutdown -s -t 1
(意思为1s后关机)
关机.bat 文件编辑把上面命令复制上去即可
指定时间睡眠命令:at 12:00 rundll32 powrprof.dll,SetSuspendState(12:00代表指定时间12点睡眠)
指定时间关机命令:at 12:00 shutdown -s
取消关机命令:shutdown -a
循环定时执行某些任务
@echo off
::@echo off 窗口命令行不再显示命令 ::代表注释
::choice延时 /t 秒
set INTERVAL=10
set hour=18
set minute=00
echo start_end_%hour%:%minute%
:: interval(间隔) 这个单位为秒 timeout 等待多少秒
::timeout %INTERVAL% %time:~0,2%从0位开始取2位数
:Again
::cls
if %time:~0,2%==%hour% (if %time:~3,2%==%minute% goto dosomething )
::指定某个时间做 dosomething任务 其余时间每10s循环:Again标签内任务
echo doing_something
if %time:~4,1%==0 cls
::timeout %INTERVAL%
choice /t %INTERVAL% /d y /n >nul
goto Again
:dosomething
echo dosomething
恶搞人的.bat