将下列代码内容复制记事本,保存文本文档,将.txt后缀更名为.bat,双击打开*.bat文件,键盘输入“1”为关机,输入“2”为重启远程计算机。
@echo off:startecho.&echo.echo 确认要关闭或者重启计算机吗?echo.&echo.echo [ 1=关闭] [ 2=重启]echo.&echo.set/p choice=请输入命令:if /i "%choice:~0,1%"=="1" (shutdown -s -t 0)if /i "%choice:~0,1%"=="2" (shutdown -r -t 0)第1页/共1页
