中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-12 06:26
47,811 主题排行 / 349,897 发帖 / 今日 0 篇 / 48,256 会员排行
DOS学习入门 & 精彩文章 (教学室) » dos使用不熟练!为实现有选择性的关机,花了几个小时!
可打印版本  2,055 / 0
第1楼 yangdao 发表于 2012-12-07 22:03
新手上路 发帖 5 积分 12
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
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023