Return Exit Code << Back



The Windows API ExitProcess allows you to terminte the current process and returns an "exit" code. Returning an exit code is useful for the program being run by a batch file or command prompt.

Use Windows
External_Function ExitProcess "ExitProcess" Kernel32.dll UInteger uExitCode Returns Integer
Move (ExitProcess(1234)) to FieldIndex

You can check the exit code of a program by examining the environment variable %ERRORLEVEL% right after the program finishes.

@ECHO OFF
Sample.exe
@ECHO %ERRORLEVEL%





Free Web Hosting