--On Friday, June 09, 2023 3:45 PM +0100 Fergus Courtney via clamav-users <clamav-users@lists.clamav.net> wrote:

Is it possible to run "clanscan - r <directory>" and "freshclam" from a
command prompt without the need of going into the C:\Program Files\ClamAV
folder to start or run these .exe's?

I tried adding the ";C:\Program Files\ClamAV" to my Windows 8.1 machine
set of system environmental variables, restarted the Command Prompt in
Admin mode and tried running "clamscan" and "freshclam" but nothing was
working. Also did a full restart and that didn't work either.

I know I'm chancing my arm on it but if it works for other programs, I
guessed it may work for clamav .exe files also.

See screenshot attached.

Please note the program works as expected when I enter in to "C:\Program
Files\ClamAV".

Commands run from a command prompt are searched for using the PATH environment variable. This is true of all the popular operating systems.

<https://www.maketecheasier.com/what-is-the-windows-path/>

As a rule, when running a system program from a script or batch file, use the full path. Quoted for Windows, since MS sticks a space in "Program Files". That insures that a malicious program can't trick your script into running its own version of a program.



_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat

Reply via email to