The CHScanner can be made scriptable by calling it from a script and suppling corresponding
parameters in the command line. I am calling this "automatic mode" from now on.
After the automatic mode execution terminates, the application returns an error code and writes an event in the Windows Event Logs, under the Application section. There are now 8 error codes (including the success one) returned and there are also 8 corresponding event ids to be written in Windows Event Log. All these are detailed in the next sections of this page.
The parameters are:
Note
The command line parameters are NOT case sensitive.
After running in automatic mode, the CHScanner application returns one of the following values:
To get the return code, in a batch file, check the value of the %errorlevel% defined variable. To do a quick test, just
do a echo %errorlevel% after calling CHScanner with some parameters in
your batch file.
After running in automatic mode, the CHScanner application will write one of the following events using Windows
Event Logs, under the Application item:
CHScanner.exe -Passive
"
will run the application in passive scanning mode.CHScanner.exe -Passive 25
" will run the application in passive scanning mode
for 25 seconds then will export the results and terminate it's execution.
CHScanner.exe -Scan testScanCfg.chs
" will run the application in automatic scanning mode,
using the scanning parameters from the testScanCfg.chs file, then will export the results and terminate it's execution.
Small and dumb example of a batch file:
@echo off
CHScanner -Passive 25
echo The application has returned the code %errorlevel%
Another, not so small but equally dumb, example of a batch file:
@echo off
CHScanner -Scan testScanCfg.chs
goto result%errorlevel%
:result0
echo Done.
goto :EOF
:result1
echo Invalid parameter !
goto :EOF
... and so on ...
[ User Guide ]