Command to return value in Windows batch file?

Solution 1:

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%

Solution 2:

In Windows:

exit /b 1