中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-13 06:58
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » 版主,“err2env”这个软件怎么用? 查看 1,308 回复 8
楼 主 版主,“err2env”这个软件怎么用? 发表于 2004-02-04 00:00 ·  中国 广东 河源 电信
高级用户
★★
积分 916
发帖 201
注册 2003-05-04 00:00
23年会员
UID 1849
性别 男
状态 离线
在DOS下我想得到运行某一个文件后的返回码如GHOST,怎样使用err2env?
如用COMMAND /Z后,运行GHOST后它会返回码0的。
2 发表于 2004-02-04 00:00 ·  中国 辽宁 沈阳 联通
铂金会员
★★★★
痴迷DOS者
积分 5,798
发帖 1,924
注册 2003-06-20 00:00
23年会员
UID 5583
性别 男
来自 金獅電腦軟體工作室
状态 离线
实际您可以用BAT文件来实现的,以下是我编写的一个批处理文件,此文件用于显示程序运行后的退出码,请看:

@echo off
REM 此处将您要的运行的程序名写上
for %%a in (0;1;2;3;4;5;6;7;8;9) do if errorlevel %%a set testerr=%%a
echo.
echo Current errorlevel is : %testerr%
echo.
set testerr=

有什么不妥之处请大家指正!
熟能生巧,巧能生精,一艺不精,终生无成,精亦求精,始有所成,臻于完美,永无止境!
金狮電腦軟體工作室愿竭诚为您服务!
QQ群:8393170(定期清理不发言者)
个人网站:http://www.520269.cn
电子邮件:doujiehui@vip.qq.com
微信公众号: doujiehui
3 发表于 2004-02-04 00:00 ·  中国 重庆 电信
银牌会员
★★★
积分 2,202
发帖 499
注册 2003-06-12 00:00
23年会员
UID 4876
性别 男
状态 离线
顺便问个没明白的问题:既然REM为程序加注解不运行,那么不写这行不完了吗? 加与不加的区别在哪儿呢? 谢谢...!
一年四季,枫叶红了又红;人生四季,失去的,还能再来吗?—— !
4 发表于 2004-02-05 00:00 ·  加拿大 安大略省 多伦多
系统支持
★★★★★★
“新DOS时代”站长
积分 27,736
发帖 10,521
注册 2002-10-09 12:00
23年会员
UID 9
状态 离线
注解只是让自己和大家看得更清楚一些嘛。。比如有时想修改源代码时这样就更加直接易行了。
Wengier - 新DOS时代

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

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

5 发表于 2004-02-05 00:00 ·  中国 广东 河源 电信
高级用户
★★
积分 916
发帖 201
注册 2003-05-04 00:00
23年会员
UID 1849
性别 男
状态 离线
版主,我是想请教err2env这个软件的具体用法,看英文说明又看不懂,能具体指点吗?
6 发表于 2004-02-05 00:00 ·  中国 辽宁 沈阳 联通
铂金会员
★★★★
痴迷DOS者
积分 5,798
发帖 1,924
注册 2003-06-20 00:00
23年会员
UID 5583
性别 男
来自 金獅電腦軟體工作室
状态 离线
能把ERR2ENV这个软件上传吗?也好让大家看一看提示信息.
熟能生巧,巧能生精,一艺不精,终生无成,精亦求精,始有所成,臻于完美,永无止境!
金狮電腦軟體工作室愿竭诚为您服务!
QQ群:8393170(定期清理不发言者)
个人网站:http://www.520269.cn
电子邮件:doujiehui@vip.qq.com
微信公众号: doujiehui
7 发表于 2004-02-05 00:00 ·  美国
系统支持
★★★★★★
“新DOS时代”站长
积分 27,736
发帖 10,521
注册 2002-10-09 12:00
23年会员
UID 9
状态 离线
Kinglion:网站的“脚本工具”中有ERR2ENV下载的:

http://newdos.yginfo.net/doswaren.htm
Wengier - 新DOS时代

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

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

8 发表于 2004-02-14 00:00 ·  中国 广东 河源 电信
高级用户
★★
积分 916
发帖 201
注册 2003-05-04 00:00
23年会员
UID 1849
性别 男
状态 离线
版主,“err2env”这个软件能在PC-DOS7.1中用么?具体怎么用?
9 发表于 2004-02-14 00:00 ·  中国 辽宁 沈阳 联通
铂金会员
★★★★
痴迷DOS者
积分 5,798
发帖 1,924
注册 2003-06-20 00:00
23年会员
UID 5583
性别 男
来自 金獅電腦軟體工作室
状态 离线
不好意思,我的E文太次了,只好将帮助文件上传,请E文好的大侠们帮忙翻译一下了。
好象软件的作者是华裔的!

北北北北北北北北北北北北?
? 辈
?ERR2ENV version 1.0 辈
? 辈
北北北北北北北北北北北北辈
膊膊膊膊膊膊膊膊膊膊膊膊?


ERR2ENV will mainly set the current errorlevel to an environment
parameter (default to ERR_LEVEL). Whenever it is run in a new DOS
version for the first time, it will work out the actual address
of the errorlevel for the new version and then store it back to the
program, so that it will be able to run instantly next time.

ERR2ENV tries to avaid DOS batch's clumsy way of finding out the
current errorlevel.


谀哪哪哪哪?
?AUTHOR: ?
滥哪哪哪哪?
Zhuhan JIANG, University of New England, Armidale NSW 2351, Australia
Email: zjiang@metz.une.edu.au


谀哪哪哪目
?FILES: ?
滥哪哪哪馁
ERR2ENV.ZIP contains the following files

readme - this file
err2env.exe - set entry errorlevel to environment parameter
err2env.c - the C source code


谀哪哪哪哪?
?FORMAT: ?
滥哪哪哪哪?
I. err2env ]
II. err2env "/qn鄕#+#-#t#" ]
where # represents an positive integer

Format I is the usual application format. All options must be
contained in a single string:

q - quiet with no non-critical messages
n - environment parameter ERR_LEVEL will not be changed
x# - exit with errorlevel specified by #
+# - exit errorlevel will be the entry errorlevel plus #
-# - exit errorlevel will be the entry errorlevel minus #
? - remove stored errorlevel addresses from ERR2ENV.EXE.
ERR2ENV.EXE can store addresses for upto 100 DOS versions,
when that is run out (possible?), we can use this option
to clear off the old version addresses to make space
for the new ones. But this is quite unlikely, so this
option should perhaps never be used.
,env - set errorlevel to the environement parameter specified
by "env"

The order of above options are interchangeable and duplicable.

Format II is essentially to be called by ERR2ENV.EXE itself. In this
format, the first three option characters must be "\".
The program will then read addresses from filein and
write those back to fileout if the values specified by
the address agrees with the value given via /t#. This
algorithm is influenced by George A Theall's method in
ERRLVL12.ZIP

Examples:
ERR2ENV /nqx25
quietly set errorlevel to 25, env para ERR_LEVEL not changed
ERR2ENV /-1,oldlevel
set OLDLEVEL to current errorlevel, say 99, exit with
new errorlevel 98, and display message: errorlevel=(99->98)


谀哪哪哪哪哪哪?
?DISCLAIMER: ?
滥哪哪哪哪哪哪?
ERR2ENV version 1.0 are provided *AS IS* without any warranty,
expressed or implied. The author will assume no liability for
damages either from the direct use of this product or as a
consequence of the use of this product.

This package can be freely distributed (FREEWARE).

熟能生巧,巧能生精,一艺不精,终生无成,精亦求精,始有所成,臻于完美,永无止境!
金狮電腦軟體工作室愿竭诚为您服务!
QQ群:8393170(定期清理不发言者)
个人网站:http://www.520269.cn
电子邮件:doujiehui@vip.qq.com
微信公众号: doujiehui
论坛跳转: