Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

unspecified file path

2 views
Skip to first unread message

file

unread,
Dec 3, 2009, 7:18:07 PM12/3/09
to
Hello everyone

I'm new to this discussion forum.
I''m a newbie in writing dos batch file and I have the following batch file
which i have managed to come upto. find below

set "file=\\servernameA\C$\dferert\tretevf\erwerew\yuyur\gtytr\testing.txt"
set "answer="
if exist "%file%" (
echo found the file on server servernameA
echo found the file on server servernameA >>"file.log"
set /p "answer=Delete the file? [y/N] :"
)
if /i "%answer%"=="y" del "%file%"

I need to change the functionality of the above script to search
"testing.txt" if the path is not specified. We have 2 drive i.e C and G
Drives on each 40 servers, so lets assume we want to search a file that could
exist anywhere either in c drive or g drive. could even be in sub folders.
the script should find
this file and ask before deleting. please help

0 new messages