Hi,
I want to know that how to return value(s) from vb.net while execute Batch file,
See my Example:
-----------------
@echo off
cls
echo started...
TestApps.exe "C:\Test\Test1.prj" "Test1.xml"
@if "%ERRORLEVEL%" == "0" goto good
@if "%ERRORLEVEL%" == "-1" goto fail
:fail
echo Execution Failed
echo return value = %ERRORLEVEL%
goto end
:good
echo Execution succeeded
echo Return value = %ERRORLEVEL%
goto end
:end
pause
1. The above code is working fine, because critical message return to the batch file (application will be closed automatically when
TestApps.exe critical exception raised),
Ex:
i. Environment.ExitCode = 0
ii. Environment.ExitCode = -1
Note1: If application closed then only return error code to the batch file.
2. But I want to know that how to return warning message code. (In this time
TestApps.exe will not be close, because it is warning message.
but I want to access warning message code in batch file without close application.
Note2: How to return value to batch file for each time getting warning message.
Give Idea.
Thanks in Advance.