hidden hit counter
Help!

batch script help

 
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Setup RSS
Next:  WHY is everyone ignoring my poll?  
Author Message
Stu
External


Since: May 27, 2010
Posts: 1



PostPosted: Thu May 27, 2010 8:11 am    Post subject: batch script help
Archived from groups: microsoft>public>windowsnt>setup (more info?)


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
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Setup All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum