Computing.Net > Forums > Programming > Batch File Renamer

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File Renamer

Reply to Message Icon

Name: tj007s13
Date: November 2, 2007 at 23:45:22 Pacific
OS: XP pro
CPU/Ram: 2GB
Product: Custom
Comment:

I need a batch file that renames a bunch of files for me. Basically each file name has 10 characters and a period(.) and then the rest of the name. The 10 characters is always the same.

For example:
mywebsite.file1.jpg
mywebsite.file2.jpg
mywebsite.file3.jpg

I just want it to be:
file1.jpg
file2.jpg
file3.jpg

So removing the first 10 characters of the file name or removing a certain phrase from the file name should work. I am a batch noob so any help I would greatly appreciate.



Sponsored Link
Ads by Google

Response Number 1
Name: wille
Date: November 3, 2007 at 09:05:46 Pacific
Reply:

Do u just want a program that renames a file or, that removes a phrase like "mywebsite" from all the filename u type in or something like that?


0

Response Number 2
Name: tj007s13
Date: November 3, 2007 at 10:34:31 Pacific
Reply:

I want to take out the phrase out of the file name. (wesite.example.jpg) I do however want to keep the ending portion of the file name (example.jpg)


0

Response Number 3
Name: tonysathre
Date: November 3, 2007 at 11:12:08 Pacific
Reply:

@echo off
for /f "tokens=1-3 delims=." %%a in ('dir /b *.jpg') do rename %%a.%%b.%%c %%b.%%c

"Computer security." — Oxymoron


0

Response Number 4
Name: tj007s13
Date: November 3, 2007 at 11:30:50 Pacific
Reply:

Ok thanks. Some are also _ (underscores) instead of periods. Would it be something like this:

@echo off
for /f "tokens=1-3 delims=_" %%a in ('dir /b *.jpg') do rename %%a_%%b_%%c %%b_%%c

??


0

Response Number 5
Name: tonysathre
Date: November 3, 2007 at 15:21:00 Pacific
Reply:

Yes, that would work.

"Computer security." — Oxymoron


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

vb6 question Visual studio 08



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch File Renamer

Batch file renaming www.computing.net/answers/programming/batch-file-renaming/18676.html

Batch file renaming www.computing.net/answers/programming/batch-file-renaming/8204.html

Automated batch-file renaming www.computing.net/answers/programming/automated-batchfile-renaming/13367.html