windows下定点关机的实现

因为有点需求所以写的一小段算是批处理代码吧,标红位置用来指示是几点关机【24小时制】还是shell好看啊。。。

@ECHO OFF
set /a start_h=”%time:~0,2%”
set /a start_m=”%time:~3,2%”
echo %start_h% %start_m%
set /a time_left=(21-%start_h%)3600+(0-%start_m%)60

ECHO shutdown after “%time_left%” seconds
pause
shutdown -s -t “%time_left%”

转载请注明来源链接 http://just4fun.im/2017/01/08/windows-e4-b8-8b-e5-ae-9a-e7-82-b9-e5-85-b3-e6-9c-ba-e7-9a-84-e5-ae-9e-e7-8e-b0/ 尊重知识,谢谢:)