Mohammad AL-Rawabdeh Asked: 2010-10-04 00:21:43 +0800 CST2010-10-04 00:21:43 +0800 CST 2010-10-04 00:21:43 +0800 CST Command to return value in Windows batch file? 772 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? windows command-line-interface 2 Answers Voted Best Answer user9517 2010-10-04T00:37:16+08:002010-10-04T00:37:16+08:00 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% bindbn 2010-10-04T00:31:54+08:002010-10-04T00:31:54+08:00 In Windows: exit /b 1
In a windows batch file to return a value back to the command shell use
e.g
will retun 3 in
%ERRORLEVEL%
In Windows: