« Sample Script: DNS KCC | Sample Script: Get today's date »

Sample Script: Errorlevel checking in batch scripts

A batch command line programming example of how to call a utility or perform a function and react according to the %errorlevel% value returned post execution.

In this example we parse a log file for an error string.

Download file

::REM *****************************************************
::REM B a t c h P r o g r a m m i n g S a m p l e
::REM from http://www.japan-page.net
::REM (C) 2002 John D. Seaman
::REM Copylefted, and released to the general Internet
::REM community, you may use, modify and release this
::REM at will as long as you retain this header.
::REM *****************************************************

Author is not responsible for accuracy or functionality of these scripts. You are strongly advised to test everything out of production. Not responsible for formatted HDD's, etc. etc.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)