How can I return a value in a Windows batch file? I can do it in Unix using exit 1 but how can I do it in Windows?

link|improve this question

Do you mean Windows BATCH file? Or do you actually have GNU Bash installed on Windows? – Zoredache Oct 3 '10 at 8:34
Windows BATCH file – Mohammad AL-Rawabdeh Oct 3 '10 at 8:46
feedback

2 Answers

up vote 3 down vote accepted

In a windows batch file to return a value back to the command shell use

exit /b yourexitcode

e.g

exit /b 3

will retun 3 in %ERRORLEVEL%

link|improve this answer
feedback

In Windows:

exit /b 1
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.