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-13 10:55
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Question about batch files View 692 Replies 2
Original Poster Posted 2004-03-23 00:00 ·  中国 安徽 淮南 电信
银牌会员
★★★
爱DOS但不迷DOS
Credits 1,708
Posts 509
Joined 2004-02-25 00:00
22-year member
UID 18460
Gender Male
From 安徽淮南
Status Offline
How do I write a batch file that exits when ESC is pressed, and continues when any key is pressed?
°·.∴▍★∴ 我们的泰坦尼克.....
   I l☆ve you!
☆.°·▍▍.☆█☆.°★ 永不会沉没.
◥█▅▅██▅▅██▅▅▅▅███◤
我的主页:http://wphs.ik8.com我的网络硬盘:wphs.ys168.com
Email:wphs@ah163.com QQ:43500498(附加消息:中国DOS联盟)
Floor 2 Posted 2004-03-23 00:00 ·  中国 辽宁 朝阳 联通
铂金会员
★★★★
痴迷DOS者
Credits 5,798
Posts 1,924
Joined 2003-06-20 00:00
23-year member
UID 5583
Gender Male
From 金獅電腦軟體工作室
Status Offline
The following is quoted from wphs0326 on 2004-3-23 0:03:59:
How do I write a batch file that exits when ESC is pressed, and continues when any key is pressed?


@echo off
ECHO Please choose A. Continue executing this batch file ESC. Exit this batch file
INKEY 99 A98 a97
IF ERRORLEVEL 99 GOTO END
IF ERRORLEVEL 98 GOTO GO

:GO
ECHO Continue executing the program
GOTO OK

:END
ECHO Exit the program

:OK

The INKEY.COM file used by the program and the batch file example:
Open attachment
熟能生巧,巧能生精,一艺不精,终生无成,精亦求精,始有所成,臻于完美,永无止境!
金狮電腦軟體工作室愿竭诚为您服务!
QQ群:8393170(定期清理不发言者)
个人网站:http://www.520269.cn
电子邮件:doujiehui@vip.qq.com
微信公众号: doujiehui
Floor 3 Posted 2004-03-23 00:00 ·  中国 安徽 淮南 电信
银牌会员
★★★
爱DOS但不迷DOS
Credits 1,708
Posts 509
Joined 2004-02-25 00:00
22-year member
UID 18460
Gender Male
From 安徽淮南
Status Offline
Thanks!!
°·.∴▍★∴ 我们的泰坦尼克.....
   I l☆ve you!
☆.°·▍▍.☆█☆.°★ 永不会沉没.
◥█▅▅██▅▅██▅▅▅▅███◤
我的主页:http://wphs.ik8.com我的网络硬盘:wphs.ys168.com
Email:wphs@ah163.com QQ:43500498(附加消息:中国DOS联盟)
Forum Jump: