renaming space-containing filenames with wildcards

  • Thread starter Thread starter Wowbagger
  • Start date Start date
W

Wowbagger

I have several dozen files with names that include spaces (all .jpg
files) that I need renamed to include a couple of words at the end of
the filename:


this is file 1.jpg --> this is file 1 by steve.jpg
this is file 2.jpg --> this is file 2 by steve.jpg
this is file 3.jpg --> this is file 3 by steve.jpg


How is the ren command formatted to account for the spaces in the
original file names and the spaces in the little text string that has
to be appended?
 
Wowbagger said:
I have several dozen files with names that include spaces (all .jpg
files) that I need renamed to include a couple of words at the end of
the filename:


this is file 1.jpg --> this is file 1 by steve.jpg
this is file 2.jpg --> this is file 2 by steve.jpg
this is file 3.jpg --> this is file 3 by steve.jpg


How is the ren command formatted to account for the spaces in the
original file names and the spaces in the little text string that has
to be appended?
These worked:

ren "this is file "?".jpg" "this is file "?" by steve.jpg"

ren "this is file "?.jpg "this is file "?" by steve".jpg

Greetz,
John7
 
Is there a way to use a * for the filename?

I tried ren *.jpg *?" by steve".jpg and ended up with

this is a test.JPG by steve.jpg

Not all of the files in the directory to be processed can be guaranteed to
have the same filename prefix - it usually looks more like

this is file a.jpg
this is file a (1).jpg
this is file a (2).jpg
another file.jpg
another file (1).jpg
something else.jpg
something else (1).jpg

and so on
 

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

Similar Threads


Back
Top