中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-06-17 15:05
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » dos使用不熟练!为实现有选择性的关机,花了几个小时! 查看 1,877 回复 0
楼 主 dos使用不熟练!为实现有选择性的关机,花了几个小时! 发表于 2012-12-07 22:03 ·  中国 河南 移动
新手上路
积分 12
发帖 5
注册 2012-12-05 11:19
UID 181054
性别 男
状态 离线
@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
论坛跳转: