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 13:15
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » [Help] Question about a batch file problem, could Master Rushi help me take a look? View 1,462 Replies 9
Original Poster Posted 2003-05-26 00:00 ·  中国 上海 徐汇区 电信
初级用户
★★
DOS爱好者
Credits 478
Posts 100
Joined 2003-04-22 00:00
23-year member
UID 1648
Gender Male
Status Offline
I changed 98 to DOS using your method, but I want to be able to choose at startup whether to enter DOS or 98, so I added this to AUTOEXEC.BAT:

choice /c:dw Dos,Windows
if errorlevel 2 echo Welcome To Dos!
if errorlevel 1 win

But no matter whether I press D or W, it only enters 98. What should I do?
Sorry to trouble you



|||||||  寻人启示:姓名:
| c●● ~年龄:20,性别:男
|  ♂▃~ 特征:帅.很帅.酷.特别酷....
| |︺英俊潇洒.风流倜傥,玉树临风→我

单钓E时代论坛
Floor 2 Posted 2003-05-26 00:00 ·  中国 湖北 武汉 江夏区 电信
元老会员
★★★★★
步行的人
Credits 9,654
Posts 3,351
Joined 2003-03-11 00:00
23-year member
UID 1113
Gender Male
From 湖北
Status Offline
Please post the complete batch file...............
弄花香满衣,掬水月在手。
明月鹭鸟飞, 芦花白马走。
我自一过后,野渡现横舟。
青云碧空在,净瓶水不流。
http://dos.e-stone.cn/guestbook/index.asp
======中國DOS聯盟=====
我的新网页http://rsds.7i24.com欢迎光顾
Floor 3 Posted 2003-05-27 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
if errorlevel 1 win

should be changed to:

if errorlevel l if not errorlevel 2 win
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 4 Posted 2003-05-27 00:00 ·  中国 上海 徐汇区 电信
初级用户
★★
DOS爱好者
Credits 478
Posts 100
Joined 2003-04-22 00:00
23-year member
UID 1648
Gender Male
Status Offline
The following is quoted from Master Rushi's post at 2003-5-26 23:54:12:
Please post the complete batch file...............

My batch file only has this little bit ^_^

|||||||  寻人启示:姓名:
| c●● ~年龄:20,性别:男
|  ♂▃~ 特征:帅.很帅.酷.特别酷....
| |︺英俊潇洒.风流倜傥,玉树临风→我

单钓E时代论坛
Floor 5 Posted 2003-05-27 00:00 ·  中国 湖北 武汉 电信
元老会员
★★★★★
步行的人
Credits 9,654
Posts 3,351
Joined 2003-03-11 00:00
23-year member
UID 1113
Gender Male
From 湖北
Status Offline
@ECHO OFF
PROMPT $p$g
set temp=%ramd%:\
set tmp=%ramd%:\
path=o:\;%RAMD%:\
choice/c:evrn please press
if errorlevel 4 goto ndd
if errorlevel 3 goto pv
if errorlevel 2 goto kv
if errorlevel 1 goto end

:Ndd
LH Ndd.exe
goto end

:pv
FINDRAMD>NUL
set path=%ramdrive%\;%path%
%ramdrive%
CD \
LH PVIEW
goto end

:kv
FINDRAMD>NUL
set path=%ramdrive%\;%path%
%ramdrive%
CD \
LH kv3000
goto end
Look at this file—what do you think your file is missing?
弄花香满衣,掬水月在手。
明月鹭鸟飞, 芦花白马走。
我自一过后,野渡现横舟。
青云碧空在,净瓶水不流。
http://dos.e-stone.cn/guestbook/index.asp
======中國DOS聯盟=====
我的新网页http://rsds.7i24.com欢迎光顾
Floor 6 Posted 2003-05-27 00:00 ·  中国 上海 徐汇区 电信
初级用户
★★
DOS爱好者
Credits 478
Posts 100
Joined 2003-04-22 00:00
23-year member
UID 1648
Gender Male
Status Offline
Although I've read the batch programming article written by the boss, I still don't really know how to use it

Is my file missing subroutines?

|||||||  寻人启示:姓名:
| c●● ~年龄:20,性别:男
|  ♂▃~ 特征:帅.很帅.酷.特别酷....
| |︺英俊潇洒.风流倜傥,玉树临风→我

单钓E时代论坛
Floor 7 Posted 2003-05-27 00:00 ·  中国 上海 徐汇区 电信
初级用户
★★
DOS爱好者
Credits 478
Posts 100
Joined 2003-04-22 00:00
23-year member
UID 1648
Gender Male
Status Offline
I just changed it to

choice /c:dw Dos,Windows
if errorlevel 2 goto win
if errorlevel 1 goto dos

:win
win

:dos
echo Welcome To Dos!!!



It worked ^_^!!
But I still don't quite understand why??

|||||||  寻人启示:姓名:
| c●● ~年龄:20,性别:男
|  ♂▃~ 特征:帅.很帅.酷.特别酷....
| |︺英俊潇洒.风流倜傥,玉树临风→我

单钓E时代论坛
Floor 8 Posted 2003-05-27 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Changing it to:

if errorlevel l if not errorlevel 2 win

works.

Because ERRORLEVEL 1 actually means ERRORLEVEL >=1

Master Rushi made this mistake just now too!
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 9 Posted 2003-05-27 00:00 ·  中国 湖北 武汉 电信
元老会员
★★★★★
步行的人
Credits 9,654
Posts 3,351
Joined 2003-03-11 00:00
23-year member
UID 1113
Gender Male
From 湖北
Status Offline
Ah~ I accept the criticism.
弄花香满衣,掬水月在手。
明月鹭鸟飞, 芦花白马走。
我自一过后,野渡现横舟。
青云碧空在,净瓶水不流。
http://dos.e-stone.cn/guestbook/index.asp
======中國DOS聯盟=====
我的新网页http://rsds.7i24.com欢迎光顾
Floor 10 Posted 2003-05-27 00:00 ·  中国 上海 徐汇区 电信
初级用户
★★
DOS爱好者
Credits 478
Posts 100
Joined 2003-04-22 00:00
23-year member
UID 1648
Gender Male
Status Offline
Thanks to both of you

|||||||  寻人启示:姓名:
| c●● ~年龄:20,性别:男
|  ♂▃~ 特征:帅.很帅.酷.特别酷....
| |︺英俊潇洒.风流倜傥,玉树临风→我

单钓E时代论坛
Forum Jump: