To save anyone else e-mailing me for the policy, here it is:
Obviously you'll need to change the paths and policy options to suit your
own needs.
Policy:
-------------------------------------------------------------------------
Type of task: Run a program using a sentinel file
Commandline: c:\f-prot\mailnew.bat ~X ~R ~S
This task should be applied before any filtering rules: TRUE
Action: Save to file and notify a user
Parameter: c:\samples\mail, mo
-------------------------------------------------------------------------
Mailnew.bat: (Bat/CMD file to run the scanner.)
-------------------------------------------------------------------------
@echo off
: Rem - %1 is the file to scan %2 is the name of the result file %3 is the
: Rem - sentinel file. The report from the scan is sent to the Result file.
: Rem - If No virus is found then the Result file is deleted prior to
: Rem - deleting the sentinel file. If a virus, or other error is
: Rem - found, then a message indicating the meaning of the return code
: Rem - is tacked on to the end of the result file. Deletion of the sentinel
: Rem - file is the last thing that takes place.
: Rem - Note 1: Some of the error codes should never occur, in this context,
: Rem - but I put them in anyway for documentation purposes, if nothing else.
: Rem - Note 2: There's colons in front of the Rem statements because blank
: Rem - labels process faster than Rem statements (the entire Rem statement
: Rem - is parsed even though it's a comment)
: Rem - No extended batch command features are used so this should work with
: Rem - *any* MS OS.
: Rem
c:\PROGRA~1\FRISKS~1\F-PROT~1\fpscan.exe %1 -s 4 -o %2
If Errorlevel 5 goto err5
If Errorlevel 4 goto err4
If Errorlevel 3 goto err3
If Errorlevel 2 goto err2
If Errorlevel 1 goto err1
Del %2
goto Finished
:Err1
echo !!!!!VIRUS FOUND!!!! >> %2
goto Finished
:Err2
echo !!!!!VIRUS FOUND!!!! >> %2
goto Finished
:Err3
echo !!!!!VIRUS FOUND!!!! >> %2
goto Finished
:Err4
echo Program terminated via ^C or Esc >> %2
goto Finished
:Err5
echo Program terminated via ^C or Esc >> %2
goto Finished
:Finished
Del %3
exit
--------------------------------------------------------------------------------
This works fine with the commandline component of F-Prot version 6 for Windows.
Regards,
Martin
<p>To save anyone else e-mailing me for the policy, here it is:</p><p>Obviously you'll need to change the paths and policy options to suit your
own needs.
Policy:
-------------------------------------------------------------------------
Type of task: Run a program using a sentinel file
Commandline: c:\f-prot\mailnew.bat ~X ~R ~S
This task should be applied before any filtering rules: TRUE
Action: Save to file and notify a user
Parameter: c:\samples\mail, mo
-------------------------------------------------------------------------
Mailnew.bat: (Bat/CMD file to run the scanner.)
-------------------------------------------------------------------------</p><p>@echo off
: Rem - %1 is the file to scan %2 is the name of the result file %3 is the
: Rem - sentinel file. The report from the scan is sent to the Result file.
: Rem - If No virus is found then the Result file is deleted prior to
: Rem - deleting the sentinel file. If a virus, or other error is
: Rem - found, then a message indicating the meaning of the return code
: Rem - is tacked on to the end of the result file. Deletion of the sentinel
: Rem - file is the last thing that takes place.
: Rem - Note 1: Some of the error codes should never occur, in this context,
: Rem - but I put them in anyway for documentation purposes, if nothing else.
: Rem - Note 2: There's colons in front of the Rem statements because blank
: Rem - labels process faster than Rem statements (the entire Rem statement
: Rem - is parsed even though it's a comment)
: Rem - No extended batch command features are used so this should work with
: Rem - *any* MS OS.
: Rem
c:\PROGRA~1\FRISKS~1\F-PROT~1\fpscan.exe %1 -s 4 -o %2
If Errorlevel 5 goto err5
If Errorlevel 4 goto err4
If Errorlevel 3 goto err3
If Errorlevel 2 goto err2
If Errorlevel 1 goto err1
Del %2
goto Finished
:Err1
echo !!!!!VIRUS FOUND!!!! &gt;&gt; %2
goto Finished
:Err2
echo !!!!!VIRUS FOUND!!!! &gt;&gt; %2
goto Finished
:Err3
echo !!!!!VIRUS FOUND!!!! &gt;&gt; %2
goto Finished
:Err4
echo Program terminated via ^C or Esc &gt;&gt; %2
goto Finished
:Err5
echo Program terminated via ^C or Esc &gt;&gt; %2
goto Finished
:Finished
Del %3
exit </p><p>--------------------------------------------------------------------------------&nbsp;</p><p>This works fine with the commandline component of F-Prot version 6 for Windows.&nbsp;</p><p>Regards,</p><p>Martin&nbsp;</p>