Wednesday, August 12, 2009

Get Exit code from a command line application

To get a Exit code from a command line application (in my case Unison for replication of files between Windows and Linux boxes), type this command after the unison run is completed:

c:\>echo %errorlevel%

Unison provides four exit codes:
* 0: successful synchronization; everything is up-to-date now.
* 1: some files were skipped, but all file transfers were successful.
* 2: non-fatal failures occurred during file transfer.
* 3: a fatal error occurred, or the execution was interrupted.

No comments:

Post a Comment