![]() |
Abakt Manual |
Following is an example of a .BAT script that calls Abakt and sends an e-mail with useful information.
You should probably modify the script a little so that it works on your system.
The script uses blat, a command line utility to send mail. Download blat.zip and extract it to "C:\Program Files\blat\".
set BLAT="C:\Program Files\blat\smtp\blat.exe"
set ABAKT="C:\Program Files\Abakt.exe"
set PROFILE=MyProfile
set HOME=C:\Documents and Settings\erik
set LOGFILE="%HOME%\Application Data\Abakt\Log\%PROFILE%.log"
set EMAIL=myName@myProvider.net
@rem == Prepare blat:
%BLAT% -install smtp.myprovider.net %EMAIL%
@rem == Call Abakt:
%ABAKT% -b -x -l -m "%PROFILE%.abp"
goto result%ERRORLEVEL%
:result0
@rem OK (0x00)
%BLAT% %LOGFILE% -s "%PROFILE% Ok" -to %EMAIL%
@goto end
:result2
@rem OK+WARNING (0x02)
%BLAT% %LOGFILE% -s "%PROFILE% Ok + Warnings" -to %EMAIL%
@goto end
:result1
@rem ERROR (0x01)
:result3
@rem ERROR+WARNING (0x03)
%BLAT% %LOGFILE% -s "%PROFILE% Failed!" -to %EMAIL%
@goto end
:end