Batch renaming files

Zom

Zom

Associate
Joined
18 Oct 2002
Posts
1,092
I have a whole load of files that I want to rename. Basically I want to remove the first 8 characters from the start of the file name. Does anyone know of any utilities that could do this for me?
 
Associate
Joined
24 Feb 2004
Posts
1,083
Location
Leeds/Cyprus
That's a toughie... It's easy to add characters to the end of filenames, as in
ren *.* *xxx.*
but removing characters I've never done... Can you give us a screenshot of the filenames in that folder? Is the rest of the filename after the first 8 digits identical in all the files?
 
Permabanned
Joined
18 May 2006
Posts
9,036
assuming all the files look like this:
"12345678abcd.jpg"


then this batch will strip the first 8 chars and rename the file:


strip.bat
-----------------------------------
cd c:\pron

for %%J in (*.JPG) do call :sub %%J

:sub
SET STRING=%1
SET STRING=%STRING:~8,15%
ECHO String: %1 -- %STRING%
ren %1 %STRING%
-----------------------------------


I'm not totally happy with this, but it appears to work OK.
(...tweakers welcome!)

let me know how it works for you :)

.
 

Zom

Zom

Associate
OP
Joined
18 Oct 2002
Posts
1,092
Thanks for all your help guys - I downloaded that bulk renaming prog. It was just the job . :)
 
Back
Top Bottom