To use ClamAV on Windows, you download the installer from the official site, run the freshclam tool to update the virus database, and execute the clamscan command to check your files for malware. This method uses the command line interface by default, though users can install third-party graphical wrappers if they prefer a visual menu. Labels and menu paths may differ slightly depending on the version installed.
Installing ClamAV on Windows
ClamAV does not install as a traditional "one-click" background service like most commercial antivirus software. You must manually set up the environment to ensure the scanner can communicate with the update servers.
- Download the Windows installer package from the official ClamAV website.
- Run the .msi installer and follow the prompts to install the software into the default directory, typically located in C:\Program Files\ClamAV.
- Open the Command Prompt as an Administrator by right-clicking the Start button and selecting Command Prompt (Admin) or Windows Terminal (Admin).
- Navigate to the ClamAV installation folder using the cd command, such as
cd "C:\Program Files\ClamAV". - Run the command
freshclamto download the latest virus definitions from the server.
If the freshclam command fails, check your internet connection or firewall settings. The scanner cannot reliably detect new threats without this initial update. You will know the update worked when the command prompt displays a "downloading" progress bar and ends with a message stating that the database is now up to date.
Running ClamAV Scans and Commands
Once the database is current, you use the clamscan tool to analyze files. Because ClamAV is a scanner rather than a real-time shield, you must tell it exactly which folders or files to inspect.
- Open the Command Prompt as an Administrator.
- Type
clamscanfollowed by the path of the folder you want to check, for example:clamscan C:\Users\YourName\Downloads. - To scan the entire hard drive, use the command
clamscan C:\. - To automatically remove infected files instead of just reporting them, add the --remove flag to your command:
clamscan --remove C:\Users\YourName\Downloads. - To move infected files to a specific quarantine folder, use the --move flag followed by the folder path:
clamscan --move=C:\Quarantine C:\Users\YourName\Downloads. - To limit the scan to only show infected files and hide clean ones, add the --infected flag:
clamscan --infected C:\Users\YourName\Downloads.
ClamAV Command Reference Table
Use these flags to modify how ClamAV behaves during a scan. Combining flags allows you to create a specific scanning profile for different types of drives.
| Flag | Action | Typical Use Case |
|---|---|---|
| -r | Recursive Scan | Scanning a folder and all its subfolders |
| --bell | Audio Alert | Hearing a beep when a virus is found |
| --log=FILE | Save to Log | Keeping a text record of scan results |
| --exclude-dir | Skip Directory | Ignoring system folders to speed up scans |
| --max-filesize=SIZE | Limit File Size | Skipping very large files (e.g., 100M) to save RAM |
ClamAV Performance and Resource Settings
Because ClamAV loads the entire virus signature database into memory, it can consume significant RAM during a scan. On a standard Windows machine, you may need to adjust how the scanner handles large files or deep directories to prevent the system from slowing down.
A typical scan of a 100 GB directory with 100,000 files may take between 30 minutes and 3 hours depending on your CPU speed and SSD read rates. If you notice the computer becoming unresponsive, use the --max-filesize flag to skip files larger than 50 MB. This prevents the scanner from attempting to load massive archive files into the system memory all at once.
To optimize the scan, avoid scanning the Windows system folder (C:\Windows) unless you suspect a rootkit, as this often triggers many "false positives" where legitimate system files are flagged as suspicious. Instead, focus your scans on user-created directories, browser cache folders, and external USB drives.
ClamAV Errors and Failed Scans
Most issues with ClamAV on Windows stem from permission restrictions or outdated databases. If the software does not behave as expected, it is usually due to one of these specific configuration errors.
Permission Denied Errors
If you see "Permission Denied" or "Cannot open file" messages during a scan, it is because the Command Prompt was not launched with Administrator privileges. ClamAV cannot read protected system files or other user profiles without elevated permissions. This results in an incomplete scan where potentially infected files are skipped entirely.
Freshclam Update Failures
A "connection timeout" or "403 Forbidden" error during the freshclam process usually means a firewall or proxy is blocking the connection to the ClamAV servers. This causes the scanner to use an old database, which means it will fail to detect any malware released in the last few weeks. Check your Windows Defender Firewall settings to ensure the ClamAV executable is allowed to communicate over the network.
False Positive Flags
ClamAV may flag legitimate software, especially specialized developer tools or encrypted archives, as "Heuristics" threats. This happens because the file structure resembles a known virus pattern. If a file is flagged but you know it is safe, do not use the --remove flag; instead, move the file to a separate folder and verify its hash online.
Memory Exhaustion
If the Command Prompt crashes or closes abruptly during a scan of a very large drive, the system has likely run out of available RAM. This occurs when scanning massive compressed files or virtual machine disks. To fix this, use the --max-filesize=20M setting to limit the amount of data the scanner loads into memory at one time.
ClamAV for Scheduled Scans and Automation
Since ClamAV does not have a built-in scheduler on Windows, you can use the Windows Task Scheduler to automate your security checks. This ensures your system is scanned weekly without manual input.
- Open the Start menu and type "Task Scheduler".
- Select "Create Basic Task" from the Actions pane.
- Name the task "ClamAV Weekly Scan" and set the trigger to "Weekly".
- For the "Action", select "Start a program".
- In the "Program/script" box, enter the full path to clamscan.exe, such as
"C:\Program Files\ClamAV\clamscan.exe". - In the "Add arguments" box, enter your desired scan parameters, such as
-r --infected C:\Users\YourName\Documents. - Finish the wizard and ensure "Run with highest privileges" is checked in the task properties to avoid the permission errors mentioned previously.
By combining a scheduled clamscan with a scheduled freshclam task, you create a basic automated antivirus system. Set the freshclam task to run daily at 2:00 AM and the clamscan task to run every Sunday. This ensures the database is always current before the full system scan begins.