THANKS @jdoe
the batch scan's all hd's and go's to end when found [cool]
but it does not display the "file not found" when not found, the batch goes to end
If the "test5NEW.exe" is not in the same file as the batch it renames the orginal the "test5.exe" to test5.exe.BACKUP[in case if the batch is run] this must not happen
question:
is it posible to display "file not found in D:\"
it display's now 5 times file not found [i have 5 hd's]
question 2:
is it posible to put this piece of code in your patch file to, it displays were the file is found [read errorlog]
echo ž found: "%%t",
i did try it with your batch file but it does not seam to work.
question 3:
I want to display in the cmd window when the file is found a few messages
like file found,go get a live or somthing like that
when i put in a echo in your batch file it does'nt display it
I have also put in my batch file some kind of error log where the file whas found
and have a nice day message
Sorry for the many questions but i'm now reading, writing, testing for 3 day's and i cant see any more what i'm doing wrong.
My batch file with out your code jdoe
it works only it does not scan all hd's and does not display "file not found"["file not found" this is what i mean with errorlevel"]
And does not end when the file is found
wy i'm asking all this well when the batch file is perfect other people
work with it to.
thanks again for your help and if you can help me with finishing this batch file i'll hop on a airplane to Cannada and marrie you
my batch:
@echo off
color 1e
ECHO.
SET MYLOG="%systemdrive%\Documents and Settings\All Users\Bureaublad\Scan.Log"
ECHO Datum: %DATE% - Tijd: %TIME% >>%MYLOG%
if not exist test5NEW.exe goto notfound
echo one moment, scanning PC....
echo.
for /f "delims=" %%t in ('dir /a /s /b C:\test5.exe') do (
echo ž Found: "%%t", and made a Backup
copy "%%t" "%%t.BACKUP" > nul
attrib -s -h -r "%%t"
copy test5new.exe "%%t" > nul
)
echo.
echo.
echo.
echo Het Orginele Bestand is Vervangen.
echo Het Bestand is Overschreven. >>%MYLOG%
echo En er is een Backup Gemaakt van het Orginele Bestand in de Zelfde Map. >>%MYLOG%
echo.
echo have a nice day.
echo have a nice day. >>%MYLOG%
echo.
echo Klaar....
echo.
echo.
echo.
goto PAUSE
echo.
:notfound
COLOR FC
echo ERROR: Het Bestand "test5new.exe", is niet gevonden...!
echo ERROR: Het Bestand "test5new.exe", is niet gevonden...! >>%MYLOG%
:PAUSE
PAUSE