![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-15 09:29 |
47,812 topics / 349,917 posts / today 0 new / 48,268 members |
| DOS开发编程 & 发展交流 (开发室) » [Help] Getting the return code. |
| Printable Version 906 / 5 |
| Floor1 zqxsl | Posted 2003-11-07 00:00 |
| 初级用户 Posts 9 Credits 133 | |
|
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?
|
|
| Floor2 zqxsl | Posted 2003-11-15 00:00 |
| 初级用户 Posts 9 Credits 133 | |
|
Can't anyone help me?
|
|
| Floor3 Roy | Posted 2003-11-15 00:00 |
| 管理员 Posts 1,633 Credits 4,869 | |
|
You can use IF ERRORLEVEL GOTO
|
|
| Floor4 zqxsl | Posted 2003-11-16 00:00 |
| 初级用户 Posts 9 Credits 133 | |
|
Thanks, I'll try it first.
|
|
| Floor5 lemonhall | Posted 2003-11-22 00:00 |
| 高级用户 Posts 183 Credits 639 | |
|
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. |
|
| Floor6 Wengier | Posted 2003-11-22 00:00 |
| 系统支持 Posts 10,521 Credits 27,736 | |
|
If you want to see the specific ERRORLEVEL value, you'd better use COMMAND /Z or ERR2ENV.
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |