1.

Solve : error level?

Answer»

Hello

what is the error level and how can I benefit from it in batch files

what we MEAN when we write :

for %%1


Best Wishesferas,

<<<"Batch Scripting : ERRORLEVEL VARIABLE on MS-DOS Client
Posted by Frank-Peter Schultze on 22-Jan-2001 16:50 (3059 reads)

http://www.fpschultze.de/smartfaq+faq.faqid+56.htm


Only NT-based operating systems automatically set the ERRORLEVEL variable to the exit code returned by the last program run.">>

The ERRORLEVEL varaiable is reserved by experienced programers for the status of the last program run. A return of 0 means the program was successful. Any other return NUMBER INDICATES an error condition unless the the code is set and returned by a call to another batch file. See Below.

http://support.microsoft.com/kb/121170
Feras,


C:\>A.bat
"Hello World"
"Call B.bat"
"We are in B.bat."
"Return exit code from B.bat"
"errorlevel=77"
77
Press any key to continue . . .
C:\>type A.bat
@ECHO OFF

echo "Hello World"

echo "Call B.bat"

Call B.bat

echo "Return exit code from B.bat"

echo "errorlevel=%errorlevel%"
echo %errorlevel%
pause

C:\>type B.bat
REM return exit code to Batch A.bat
@ECHO OFF

echo "We are in B.bat."

exit /B 77

C:\>thank you very much M.r billrich



Discussion

No Comment Found