Last active
October 15, 2025 13:21
-
-
Save tassoman/a3e6fbbbc0e69aa4e56610429d0cb3c6 to your computer and use it in GitHub Desktop.
A simple ClamAV integration with Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Windows Registry Editor Version 5.00 | |
| [HKEY_CLASSES_ROOT\Directory\shell\RunClamScan] | |
| @="ClamAV, scan all Folders" | |
| "Icon"="\"%ProgramFiles%\\ClamAV\\clamscan.exe\",0" | |
| [HKEY_CLASSES_ROOT\Directory\shell\RunClamScan\command] | |
| @="\"%USERPROFILE%\\RunClamScan-Dir.bat \"%V\"" | |
| [HKEY_CLASSES_ROOT\Directory\background\shell\Powershell] | |
| @="@shell32.dll,-8508" | |
| "Extended"="" | |
| "NoWorkingDirectory"="" | |
| "ShowBasedOnVelocityId"=dword:00639bc8 | |
| [HKEY_CLASSES_ROOT\Directory\background\shell\Powershell\command] | |
| @="powershell.exe -noexit -command Set-Location -literalPath '%V'" | |
| [HKEY_CLASSES_ROOT\*\shell\RunClamScan] | |
| @="ClamAV, scan a File" | |
| "Icon"="\"%ProgramFiles%\\ClamAV\\clamscan.exe\",0" | |
| [HKEY_CLASSES_ROOT\*\shell\RunClamScan\command] | |
| @="\"%USERPROFILE%\\RunClamScan-File.bat \"%V\"" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-16"?> | |
| <!-- :: Released (CC-BY-SA-NC) https://gist.github.com/tassoman/a3e6fbbbc0e69aa4e56610429d0cb3c6 --> | |
| <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
| <RegistrationInfo> | |
| <Date>2024-10-12T03:16:13.9237462</Date> | |
| <Author>WIN10\Administrator</Author> | |
| <Description>ClamAV Viruses Database update task</Description> | |
| <URI>\FreshClam</URI> | |
| </RegistrationInfo> | |
| <Triggers> | |
| <CalendarTrigger> | |
| <Repetition> | |
| <Interval>PT1H</Interval> | |
| <Duration>P1D</Duration> | |
| <StopAtDurationEnd>false</StopAtDurationEnd> | |
| </Repetition> | |
| <StartBoundary>2024-10-12T04:10:00</StartBoundary> | |
| <Enabled>true</Enabled> | |
| <ScheduleByDay> | |
| <DaysInterval>1</DaysInterval> | |
| </ScheduleByDay> | |
| </CalendarTrigger> | |
| </Triggers> | |
| <Principals> | |
| <Principal id="Author"> | |
| <UserId>S-1-5-21-1301962884-447142648-441302601-500</UserId> | |
| <LogonType>InteractiveToken</LogonType> | |
| <RunLevel>HighestAvailable</RunLevel> | |
| </Principal> | |
| </Principals> | |
| <Settings> | |
| <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> | |
| <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> | |
| <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> | |
| <AllowHardTerminate>true</AllowHardTerminate> | |
| <StartWhenAvailable>false</StartWhenAvailable> | |
| <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> | |
| <IdleSettings> | |
| <StopOnIdleEnd>true</StopOnIdleEnd> | |
| <RestartOnIdle>false</RestartOnIdle> | |
| </IdleSettings> | |
| <AllowStartOnDemand>true</AllowStartOnDemand> | |
| <Enabled>true</Enabled> | |
| <Hidden>false</Hidden> | |
| <RunOnlyIfIdle>false</RunOnlyIfIdle> | |
| <WakeToRun>false</WakeToRun> | |
| <ExecutionTimeLimit>PT72H</ExecutionTimeLimit> | |
| <Priority>7</Priority> | |
| </Settings> | |
| <Actions Context="Author"> | |
| <Exec> | |
| <Command>%USERPROFILE%\RunFreshClam.bat</Command> | |
| </Exec> | |
| </Actions> | |
| </Task> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| :: Released (CC-BY-SA-NC) https://gist.github.com/tassoman/a3e6fbbbc0e69aa4e56610429d0cb3c6 | |
| if "%~1"=="" ( | |
| echo Please provide a File to scan. | |
| exit /b | |
| ) | |
| "C:\Program Files\ClamAV\clamscan.exe" "%~1" | |
| timeout /t 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| :: Released (CC-BY-SA-NC) https://gist.github.com/tassoman/a3e6fbbbc0e69aa4e56610429d0cb3c6 | |
| if "%~1"=="" ( | |
| echo Please provide a directory to scan. | |
| exit /b | |
| ) | |
| "C:\Program Files\ClamAV\clamscan.exe" "%~1" --recursive | |
| timeout /t 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| :: Released (CC-BY-SA-NC) https://gist.github.com/tassoman/a3e6fbbbc0e69aa4e56610429d0cb3c6 | |
| :: Switch comments, for debug purposes. | |
| :: "C:\Program Files\ClamAV\freshclam.exe" --stdout | |
| "C:\Program Files\ClamAV\freshclam.exe" | |
| :: Play three beeps at 2450 Hz, 500 ms long, with 50 ms pause | |
| for /l %%i in (1,1,3) do ( | |
| powershell -c "[console]::beep(2450, 500)" | |
| :: ping -n 1 -w 25 127.0.0.1 >nul | |
| ) | |
| :: Optional: Add a final timeout if you want to wait after the beeps | |
| :: timeout /t 5 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I made this simple integration of ClamAV in windows.
You can automagically ™️ keep virus database updated, and run virus check on demand inside File Explorer. Just right click the file or folder.
When you install ClamAV, consider to use default path configuration.
Also remember to install it as service:
"c:\Program Files\ClamAV\clamd.exe" --install-serviceUsage
C:\Users\YourName.Released under (CC-BY-NC-SA)