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-01 04:36
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » [Help] Getting the return code. View 809 Replies 5
Original Poster Posted 2003-11-07 00:00 ·  中国 广东 肇庆 电信
初级用户
Credits 133
Posts 9
Joined 2003-10-08 00:00
22-year member
UID 10867
Gender Male
Status Offline
How do I get a program's return code (for example, a C program's return code) in AUTOEXEC.BAT and run the corresponding program?
Floor 2 Posted 2003-11-15 00:00 ·  中国 广东 肇庆 电信
初级用户
Credits 133
Posts 9
Joined 2003-10-08 00:00
22-year member
UID 10867
Gender Male
Status Offline
Can't anyone help me?
Floor 3 Posted 2003-11-15 00:00 ·  中国 香港 有线宽频用户
管理员
★★★★
專業島民
Credits 4,869
Posts 1,633
Joined 2002-12-10 00:00
23-year member
UID 465
Gender Male
Status Offline
You can use IF ERRORLEVEL GOTO
我的網站:http://mw16.2ya.com/ 我的網誌: http://scrappedblog.blogspot.com/
~
我的Winamp正在播放的歌曲:
Floor 4 Posted 2003-11-16 00:00 ·  中国 广东 肇庆 电信
初级用户
Credits 133
Posts 9
Joined 2003-10-08 00:00
22-year member
UID 10867
Gender Male
Status Offline
Thanks, I'll try it first.
Floor 5 Posted 2003-11-22 00:00 ·  中国 陕西 西安 教育网
高级用户
★★
OS/2女孩
Credits 639
Posts 183
Joined 2003-06-14 00:00
23-year member
UID 5148
Gender Female
Status Offline
Just a reminder, this command
IF ERRORLEVEL GOTO LABEL
when checking, as long as there is a return code greater than N, it will recognize it.
That is, if you want to write something like a SWITCH, take note.
Put the larger N conditions first, and the smaller N ones later.
REM 喜欢DOS,因为它的简单
REM 喜欢OS/2,因为它不再矫饰
REM 喜欢BASIC,因为它并不幼稚
REM 喜欢GNU,因为它杂乱无章
Floor 6 Posted 2003-11-22 00:00 ·  加拿大 安大略省 多伦多
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
If you want to see the specific ERRORLEVEL value, you'd better use COMMAND /Z or ERR2ENV.
Wengier - 新DOS时代

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

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

Forum Jump: