Link to home
Start Free TrialLog in
Avatar of Ted Palmer
Ted PalmerFlag for United States of America

asked on

Run Clamwin - ClamAV in CMD or BAT file using Windows Server 2003 scheduler

EE Experts,

I am not having problems with viruses that I know of. I can run Clamwin as a Windows GUI application without any problems and get useful results. There is a sample command line in Clamwin Help as follows

clamscan.exe --database="C:\Program Files\ClamWin\db" --recursive C:\

But when I run it I get the following error message

++++++++++++++++++++++++++++++++++++++++++
>clamscan.exe --database="C:\Program Files\ClamWin\db" --recursive C:\
LibClamAV Error: cl_load(): Can't get status of C:\Program Files\ClamWin\db
ERROR: Can't get file status

----------- SCAN SUMMARY -----------
Known viruses: 0
Engine version: 0.97.4
Scanned directories: 0
Scanned files: 0
Infected files: 0
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 0.000 sec (0 m 0 s)
++++++++++++++++++++++++++++++++++++++++++

It appears to me that clamscan.exe program can not find the virus signature database. I know that there has to be one because I get daily messages how the clam update program was successful at downloading and applying the updates. From the command line parameters given in Help it would appear to me that the database is in a file "C:\Program Files\ClamWin\db" but I can not find a file named "db" in any folder.

I want to put this command line in a BAT file that I clone from that shows the start and end times and redirects the command line output to a unique filename based on the date and time. Then I want to put that BAT file in the job scheduler so that I can run it every night and check the results in the unique file I just described. Does anybody know how to fix this command line so that it will find the virus signature database and run a Clam scan for me?

Thank you in advance for any help you can give me.

Ted Palmer
ASKER CERTIFIED SOLUTION
Avatar of Rob Miners
Rob Miners
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ted Palmer

ASKER

rrjmin0

Thank you. You got it. My Clamscan ran for 5.5 hours last night. Now I have to look over the list of command line parameter flags, options, whatever they are called and eliminate the Clamscan.exe program from outputting the name of every file it scans. That would fill up a log file way too much. I am going to wrap this command line in a BAT file that I use for running backups with WinZip. I guess I said that already in my question. I'll close this out and award you the points. Your command line that you gave me ran fine without modification. I'll post that batch file here later in case anybody wants to use it.
Thank you. You do good work..!!

Ted Palmer
Glad to see it sorted and your welcome.

Rob
This is the DOS batch file that I said above that I would upload. I realize that DOS batch is very old school and there is sure to be a better way to do this with VB script. But this is the way I have been executing comandline programs in the Windows Job scheduler for years. As long as it works, I continue to use it because I am familiar with it and it works for me.

I had to rename the extension from BAT to TXT to get it to up load, So if you want to run it, you will have to rename it back.

Ted Palmer
RunClamscan.txt