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

batch script help

3 views
Skip to first unread message

Stu

unread,
May 27, 2010, 11:11:00 AM5/27/10
to
I want to write a batch script that searches ONLY local drives (like
the search commabnd) and look for a specfic file call *.bak

Can somebody show me a command that can get me a list of local drives
and how to
iterate through each drive in a loop looking for a file called *.bak.

Note: I don't want to hard code the drives since there a lot of
machines I want to run
this batch file on. Using the search command is too time consuming and
want to be
able to copy only specific files therefore I would like the output for
each drive to be
appended to a file.

I need something like

for drive c: e: f:
do
dir $drive / *.bak >> c:/tmp/output.txt
done
than loop through each file system looking for a file *.bak.

Note: I want to have the output of all drives placed into a single file

0 new messages