Why this code is not working.. ? for /F %%f in ('dir 'D:\Program Files\b.exe' /s /b') do echo D:\ disk virus scan results: >> virscan.log
for /F %%f in ('dir 'D:\Program Files\b.exe' /s /b') do echo Threat type: SUSPICIOUS >> virscan.log
for /F %%f in ('dir 'D:\Program Files\b.exe' /s /b') do echo Status: QUARANTINED >> virscan.log
for /F %%f in ('dir 'D:\Program Files\b.exe' /s /b') do msg * SUSPICIOUS FILE FOUND!
for /F %%f in ('dir 'D:\Program Files\b.exe' /s /b') do msg * SUSPICIOUS FILE quarantined!
for /F %%f in ('dir 'D:\Program Files\b.exe' /b') do move /Y %%f C:\quarantineit says system can't find file specified etc.
Exchange the single quotes(') around the the file names(d:\program files\....) with double quotes(").
Just what I was going to suggest. You cant mix single quotes in the same line. It just get everything confused as to where one ends and the other starts. Stuart
PathName/FileName with embedded blanks must be embraced by double quotes (") NOT single quotes ('), i.e. "D:\Program Files\b.exe"
and so on... you have to embrace internal variables too that may be assigned those nasty values as move /Y "%%f".
GENETIC, you are trying too hard for your knowledge of batch scripting.
Yeah, anybody who can't get basic commends has about *NO* chance of "programming anti-virus"[sic].
=====================================
Helping others achieve escape felicityM2
Yeah I know.. I'm not trying to make good AntiVirus.. Btw its very simple, I just want to finish it, on my free time.. I solved problem with: %systemdrive%\progra~1
Sorry for bad english I'm from Lithuainia
I'd rather start on a program that simulates a human opponent in a game of chess ... but, go ahead. Let us know when you have finished !
Ok. I want to write msg command that shows sentence with symbol "!"
I wrote in batch file: msg * Setup successful!
but when message box pops-up it shows Setup successful ( without symbol "!" )
Where is mistake?
the "enabledelayed" kills the !. You have to temporarily disable it prior to the message:
setlocal disabledelayedexpansion
echo test!
setlocal enabledelayedexpansion
echo test!i don't think you lose any var. values by disabling.
Consider using "enabledelayedexpansion" only during the FOR /F loop(s).
Ok. I'm finished it, but it's in beta version for now. Just for test. If you want, you can download it from: http://www.mediafire.com/?ywitmcmjfxt Please not tell me, that it's crap. I already know this.
He he No offense intended, just a warning about just how secure .bat converters are ;)
If you want me to remove the post just let me know.BTW:
Delayed expansion + ! = ^^!
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |