::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 ***************************************************** ::REM Parse a log file (log.txt) and look for any occurrence of the ::REM text "logon failure", then react accordingly. ::REM Errorlevel 0 = logon errors occurred ::REM Errorlevel 1 = nothing ::REM Get input from file to find command, use errorlevel ::REM to do the resulting logic for success / failure find /i "logon failure"