利用批处理事先自动关机

闲着无聊就写了一个自动关机的批处文件,在任务计划中添加可以定时关机

利用批处理自动关机,新建一个txt的文本文件 在里面写下如此代码:

@echo.
@echo.
@echo.
@echo         ┌─────────────────────────────┐
@echo         │                                                        │
@echo         │                                                        │
@echo         │                                                       │
@echo         │                   休息时间到了!!                     │
@echo         │                                                       │
@echo         │                                                       │
@echo         │                                                        │
@echo         │                   1分钟后关机!!            │
@echo         │                                       │
@echo         │                                            │
@echo         │                                                     │
@echo         └─────────────────────────────┘
@echo off
@echo.& shutdown -s -t 60
set shut=””
set /p shut= /Y 取消自动关机/H 马上关机/R 马上重启/N 关闭此窗口 (Y/H/R/N):
IF NOT “%shut%”==”” (
if %shut% NEQ “” SET shut=%shut:~0,1%
) else (
set shut=””)
if /i %shut%==y shutdown -a
if /i %shut%==h Start C:\WINDOWS\快速关机(Ctrl+Alt+End).exe
if /i %shut%==r Call “C:\WINDOWS\快速重启(Ctrl+Alt+Home).exe”
exit

最后保存的时候改名为:1分钟后关机.bat

双击运行就可以了,

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Captcha Code