Board logo

标题: dos使用不熟练!为实现有选择性的关机,花了几个小时! [打印本页]

作者: yangdao     时间: 2012-12-7 22:03    标题: dos使用不熟练!为实现有选择性的关机,花了几个小时!

@echo off
if exist 19900718.txt del 19900718.txt&goto c
echo yang_dao>19900718.txt
start a.bat
set tt=20
:a
mode con cols=50 lines=10&color 0f
cls&title %tt%
echo after %tt%&echo the computer will be shutdown!!!
if %tt%==0 shutdown -s -t 3&exit
if exist 19891206.txt del 19891206.txt&exit
set var=%time:~7,1%
:b
set num=%time:~7,1%
if %var%==%num% (goto b) else (set var=%time:~7,1%)
set /a tt-=1
goto a
:c
mode con cols=50 lines=3&color 0c
echo Do you want to do that?&echo 1-YES 2-NO
set choice=
set /p choice=please change 1/2 and enter
if /i '%choice%'=='1' exit
if /i '%choice%'=='2' goto shutdown -a&echo yang_dao>19891206.txt&exit
exit