Page 1 of 1

DOS Renaming Batch File

Posted: Sun Apr 29, 2007 8:52 pm
by Grim...
I'm well aware the this would be easy to do in a quick perl script, but all I have access to is DOS, so it's got to be a batch script (if it can be).

Basically, I have a folder (let's call it c:/folder) with a load of images in, named something like
"7556 - my house.jpg" or
"0451 - big hill.jpg" etc.

What I'd like to do is have a batch file take away the first seven characters of each filename (ie. the number, dash and the spaces) in the folder, so I'd be left with
"my house.jpg"" and
"big hill.jpg"

This page may contain clues but I don't know how to plug that into a RENAME function.

Posted: Wed May 02, 2007 7:07 pm
by timclaason
You could try:

Code: Select all

ren ???????*.jpg *.jpg
Make sure to test it in a dummy directory before going live with it