@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=
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 [/qn鄕#+#-#[,envpara]]
II. err2env "/qn鄕#+#-#t#[,envpara]" [fileout [filein] ]
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).