batch delete

K

Karl

Hi,

If I have copies of files that have a number one after them (e.g.
vacation.jpg and vacation(1).jpg) and I want to delete all the files in my
directory that have the (1) after them what command/switches would I use?

Someone suggested doing a search for files that have the (1) after the
filename, which would probably be easier, but just for learning purposes,
would like to know how to do it as above.

Thanks,

Karl
 
K

Karl

Or, another example "copy of vacation.jpg" and I want to remove all files
prefixed with "copy of".
 
K

Karl

David,

While waiting for a response I have practiced (on fake files I set up just
in case) and was able to figure it out for both (1) and "copy of" examples.
Just nice to have some validation or confirmation : )

Thanks!


"David Candy" <.> wrote in message
Work it out for yourself. Practise with the dir command.
dir "* (1).*" /s
 
G

Guest

The important items to remember are the 2 wildcard characters, * and ?. *
means "any single or multiple characters (including nothing)" and ? means
"any single character". So for Example, you could either do:

c:\>del vacation*.jpg

or, to be more specific

c:\>del vacation(?).jpg

or, to generalize further

c:\>del *(?)*.*

which would delete any file where the name contains a parenthesis with ONE
character between them.
 
K

Karl

Very helpful. Thanks!


RayBccul-- said:
The important items to remember are the 2 wildcard characters, * and ?. *
means "any single or multiple characters (including nothing)" and ? means
"any single character". So for Example, you could either do:

c:\>del vacation*.jpg

or, to be more specific

c:\>del vacation(?).jpg

or, to generalize further

c:\>del *(?)*.*

which would delete any file where the name contains a parenthesis with ONE
character between them.
 

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