Computing.Net > Forums > Disk Operating System > HELP Renaming files with a .bat file

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.

HELP Renaming files with a .bat file

Reply to Message Icon

Name: Pete Smith
Date: August 4, 2000 at 19:49:21 Pacific
Comment:

I have tried lots of ways to rename files by using a batch file but I can not add prefixes to the my old file names by using wild cards. Is there a way to rename with wild cards as the samples below.
old name
123.txt
456.txt
789.txt
to
new name
aaa123a.txt
aaa456a.txt
aaa789a.txt

I have about 7,000 files to rename like the above sample so if anyone knows how to do this with a batch file or some other way in dos or windows I would greatly appreciate your help



Sponsored Link
Ads by Google

Response Number 1
Name: W0rm
Date: August 4, 2000 at 20:15:50 Pacific
Reply:

I'm not sure, but:

REN ???.TXT aaa???a.TXT

could be wrong.


0

Response Number 2
Name: JR
Date: August 5, 2000 at 05:04:23 Pacific
Reply:

for %i in (*.*) do ren %i aaa%i

should work. If you put this in a .bat file, use

for %%i in (*.*) do ren %%i aaa%%i


0

Response Number 3
Name: Jason
Date: August 5, 2000 at 10:47:09 Pacific
Reply:

im new at batch. but dont u have to add the file extension?
for %%i in (*.*) do ren %%i aaa%%i.%1

or

for %%i in (*.*) do ren %%i aaa%%i.txt
something like that?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: HELP Renaming files with a .bat file

Find and Replace with a BAT file?!!!! www.computing.net/answers/dos/find-and-replace-with-a-bat-file/3291.html

Making a .bat file to get input NT www.computing.net/answers/dos/making-a-bat-file-to-get-input-nt/12892.html

Sequential renaming files www.computing.net/answers/dos/sequential-renaming-files/12895.html