Delete Files From Subdirectory

S

Shaun

Hi,

Please could someone help me with a problem. I need to scan through about
1000 folders and all their subdirectories and remove any files that aren't
jpeg's. Is there a simple way to do this from the command prompt?

Any help with this would be greatly appreciated.
 
M

Manny Borges

Assuming these are all part of a single folder tree.
You can do it gui.

Go to the Start/Search.
Choose all files and folders.
Go to the "Look In:" box and pull it down to select browse.
Choose the parent folder of the tree.
Do not type in a name in the file name box.
Hit search.
When its all done just order the results by file type and you should be able
to easily wipe out the non jpegs.


Alternately go to a prompt.

I will asume c:

md c:\newroot
cd c:\oldroot
xcopy *.jpg c:\newroot /s /x

Go verify that the files and directories mad it there.

Delete the old root directory.

--
Manny Borges
MCSE NT4-2003 (+ Security)
MCT, Certified Cheese Master

There are 10 kinds of people in the world. Those who do understand binary
and those who don't.
 
P

Pegasus \(MVP\)

Shaun said:
Hi,

Please could someone help me with a problem. I need to scan through about
1000 folders and all their subdirectories and remove any files that aren't
jpeg's. Is there a simple way to do this from the command prompt?

Any help with this would be greatly appreciated.

You could run this command from a Command Prompt:

xxcopy.exe /x*.jpg /rs /yy /s *.* c:\temp\

I recommend that you create a copy of your folder and test the
command before running it on the real thing.

You can download xxcopy.exe from a number of sites.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top