China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-12 07:16
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Not proficient in using DOS! Spent several hours to achieve selective shutdown! View 2,058 Replies 0
Original Poster Posted 2012-12-07 22:03 ·  中国 河南 移动
新手上路
Credits 12
Posts 5
Joined 2012-12-05 11:19
13-year member
UID 181054
Gender Male
Status Offline
@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
Forum Jump: