ClamWin Free Antivirus Forum Index
ClamWin Free Antivirus
Support and Discussion Forums
Reply to topic
clamscan.exe returning errorlevel 0 if virus found!
pgudge


Joined: 17 Aug 2010
Posts: 0
Reply with quote
I have a batch command running clamscan.exe against a folder with some files in, including Eicar files. When the scan has completed it doesn't return a errorlevel of 1.

Any ideas?

Code:
C:\Temp\l\tmp\eicar.com: Eicar-Test-Signature FOUND
C:\Temp\l\tmp\eicar.com.txt: Eicar-Test-Signature FOUND
C:\Temp\l\tmp\eicarcom2.zip: Eicar-Test-Signature FOUND
C:\Temp\l\tmp\eicar_com.zip: Eicar-Test-Signature FOUND

----------- SCAN SUMMARY -----------
Known viruses: 815287
Engine version: 0.96.1
Scanned directories: 1
Scanned files: 10
Infected files: 4
Data scanned: 34.17 MB
Data read: 34.05 MB (ratio 1.00:1)
Time: 8.467 sec (0 m 8 s)

Clam 0

Last line in Batch is

Code:
"C:\Program Files (x86)\ClamWin\bin\clamscan.exe" --database="C:\ProgramData\.clamwin\db" --recursive "C:\Temp\l\tmp" --log=C:\Temp\l\log.txt
echo Clam %errorlevel%


Thanks,
View user's profileSend private message
pgudge


Joined: 17 Aug 2010
Posts: 0
Reply with quote
Would appear to have been an error in my batch file. The following works with correct return codes!

Code:
"C:\Program Files (x86)\ClamWin\bin\clamscan.exe" --database="C:\ProgramData\.clamwin\db" --recursive "C:\Temp\l\tmp" --log=C:\Temp\l\log.txt %1
IF ERRORLEVEL 1 exit /b 2
IF ERRORLEVEL 0 exit /b 0
View user's profileSend private message
clamscan.exe returning errorlevel 0 if virus found!
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic