This script will automatically virus scan downloaded files using the free ClamWin Antivirus package. These instructions are for SABnzbd on Windows.
It will prefix the directory with _VIRUS_ when a virus is found in the downloaded stuff, it won’t delete files but just reminds you that you’ve downloaded hazardous stuff
To set this up follow the these steps:
@echo off set name=%3 set name=%name:"=% set dirname=%1 set dirname=%dirname:"=% "C:Program Files (x86)ClamWinbinclamscan.exe" --tempdir "c:tempclamscan" --keep-mbox --stdout --database="C:ProgramData.clamwindb" --log="c:tempclamscan.log" --no-mail --infected --max-files=500 --max-scansize=150000M --max-recursion=5 --max-filesize=100000M --recursive --kill "%dirname%" @echo %errorlevel% if not errorlevel 1 goto novirus goto virus :virus echo virus found! echo ___WARNING VIRUS FOUND___ > "%dirname%___WARNING VIRUS FOUND___" rem make sure the drive letter below matches your download destination drive!! c: cd "%dirname%" cd.. move "%name%" "_VIRUS_%name%" goto end :novirus echo no virus found! goto end :end
No comments yet.
RSS feed for comments on this post.
Sorry, the comment form is closed at this time.