Differences
This shows you the differences between the selected revisions of the page.
2014-09-18 | 2014-09-18 | ||
exit code of a batch file (martin) | suggest returns exit code from batch (martin) | ||
Line 119: | Line 119: | ||
* Save and inspect output of the script. Use [[executables|output redirection]]. | * Save and inspect output of the script. Use [[executables|output redirection]]. | ||
- | Once you find out what was the result of the script, you can perform any action you like. E.g. after evaluating exit code of WinSCP, you can send a "success" or "error" email. For that use any command-line email client you like, e.g. [[http://glob.com.au/sendmail/|sendmail]]((When installing sendmail, you can ignore all references to ''/usr/lib/'' (or ''c:\usr\lib'') directories in its installation instructions, as you will be running ''sendmail.exe'' directly from a Windows batch file. Just place sendmail files to any convenient location, e.g. along with WinSCP.)). See example batch file: | + | Once you find out what was the result of the script, you can perform any action you like. E.g. after evaluating exit code of WinSCP, you can send a "success" or "error" email. For that use any command-line email client you like, e.g. [[http://glob.com.au/sendmail/|sendmail]]((When installing sendmail, you can ignore all references to ''/usr/lib/'' (or ''c:\usr\lib'') directories in its installation instructions, as you will be running ''sendmail.exe'' directly from a Windows batch file. Just place sendmail files to any convenient location, e.g. along with WinSCP.)). |
+ | |||
+ | You should also make the batch file indicate a result in its exit code, particularly if it is called from some parent system (for example [[guide_ssis|SSIS]]). | ||
+ | |||
+ | See an example batch file: | ||
<code batch> | <code batch> |