.
2010-05-19 12:56:38 UTC
On Windows XP this is what I'm doing...
Make a batch file to manually scan a system drive,
currently ClamAV's gui doesn't do it, it only scans
for open files and running processes. My problem
is when the for loop reads the text file, if there's a space
in the text it only rads the first part, it hits the space
and goes to the next line.
My question - how can I have it read the full line including
the spaces? I've searched a bit but can't find the answer.
Hoping you batch file guru's can help me out ;-)
I'll give credit to whom credit is do oh great ones!
********************************************************************
:: Get a directory listing from the root system drive
%systemdrive%
cd\
dir /AD /B > dirs.txt
:: Now, lets scan with ClamAV all our directories
:: Change to ClamAV's Windows Directory
cd %ProgramFiles%\ClamAV for Windows\1.0.26"
for /f %%i in (c:\dirs.txt) do agent -d "%systemdrive%\%%i"
********************************************************************
dirs.txt file contents:
18051861446c3b9886
6541fd42d4b32dc25a13c9b65107
9b767b163a3212d9d2fd65bd
dell
Documents and Settings
drivers
i386
MSOCache
MySlaxTemp
NVIDIA
Program Files
RECYCLER
sysprep
System Volume Information
temp
WINDOWS
********************************************************************
ClamAV kicks off a scan just fine and dandy, it iterates through
each folder in the text file UNTIL it hits one with a space like
Program Files or Documents and Settings.
What I don't understand is I have it quoted but I don't think
it's my quotes, it seems to be a problem with how the command
line is reading the text file, it hits a space and moves to the next
line. Is there any way to have it read the whole line in the text
file?
Error output is this:
C:\Program Files\ClamAV for Windows\1.0.26>agent -d "C:\Documents"
May 19 08:58:20: ERROR: Scan::Directory: unable to open directory :
3 : The syst
em cannot find the path specified.
Thanks!
Make a batch file to manually scan a system drive,
currently ClamAV's gui doesn't do it, it only scans
for open files and running processes. My problem
is when the for loop reads the text file, if there's a space
in the text it only rads the first part, it hits the space
and goes to the next line.
My question - how can I have it read the full line including
the spaces? I've searched a bit but can't find the answer.
Hoping you batch file guru's can help me out ;-)
I'll give credit to whom credit is do oh great ones!
********************************************************************
:: Get a directory listing from the root system drive
%systemdrive%
cd\
dir /AD /B > dirs.txt
:: Now, lets scan with ClamAV all our directories
:: Change to ClamAV's Windows Directory
cd %ProgramFiles%\ClamAV for Windows\1.0.26"
for /f %%i in (c:\dirs.txt) do agent -d "%systemdrive%\%%i"
********************************************************************
dirs.txt file contents:
18051861446c3b9886
6541fd42d4b32dc25a13c9b65107
9b767b163a3212d9d2fd65bd
dell
Documents and Settings
drivers
i386
MSOCache
MySlaxTemp
NVIDIA
Program Files
RECYCLER
sysprep
System Volume Information
temp
WINDOWS
********************************************************************
ClamAV kicks off a scan just fine and dandy, it iterates through
each folder in the text file UNTIL it hits one with a space like
Program Files or Documents and Settings.
What I don't understand is I have it quoted but I don't think
it's my quotes, it seems to be a problem with how the command
line is reading the text file, it hits a space and moves to the next
line. Is there any way to have it read the whole line in the text
file?
Error output is this:
C:\Program Files\ClamAV for Windows\1.0.26>agent -d "C:\Documents"
May 19 08:58:20: ERROR: Scan::Directory: unable to open directory :
3 : The syst
em cannot find the path specified.
Thanks!