Computing.Net > Forums > Disk Operating System > Renaming multiple files

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.

Renaming multiple files

Reply to Message Icon

Name: yhprum
Date: June 5, 2009 at 01:28:35 Pacific
OS: Windows XP
Subcategory: General
Comment:

Hello,

I have some txt files ending .1, .2, .3, .4 etc. I like to rename all those files into .doc (eg change xxx.1 to xxx.1.doc). Possible???



Sponsored Link
Ads by Google

Response Number 1
Name: Lanttu42
Date: June 5, 2009 at 03:00:04 Pacific
Reply:

Go to command shell and move to directory where you have those files, and type:

rename *.txt *.doc

That should do it.


0

Response Number 2
Name: DAVEINCAPS
Date: June 5, 2009 at 09:48:09 Pacific
Reply:

I think it would be ren *.? *.?.doc since they don't appear to have a .txt extension. Also, that should give them the double extension, for example XXX.1.doc.

In that the * means 'any file' and the ? is a wildcard that replaces a single character. That is, it apples to files with an extension 1, 2, 3, a, b, etc. It won't cover two or three character extensions. So if your file is named ???.12 it won't work. In that case you could use ren *.?? *.??.doc

It's going to be easier to rename the files if the directory only contains the files you want renamed and not any others.


0

Response Number 3
Name: Mechanix2Go
Date: June 6, 2009 at 02:50:00 Pacific
Reply:

In any case, this is not a DOS filename:

xxx.1.doc


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 4
Name: yhprum
Date: June 7, 2009 at 18:08:51 Pacific
Reply:

Hello DAVEINCAPS & all,

Thank you all for your help.

I had a substantial of files with dates appending behind (eg xxxx.26.5.2009.1.104) and I tried ren*.?? *.??.doc. It didnt work as it worked only for 2 char ext. So I changed it to ren*.??? *.???.doc
IT WORKS!


0

Response Number 5
Name: Hansum Krishna
Date: June 10, 2009 at 22:20:48 Pacific
Reply:

it is very simple.....
copy all the files in a folder.......
create a new file "rename.bat"
right click on it and press edit....
type the following data in it
====

@echo off
ren *.* *.doc

====

then save the file and run it in the same folder....
and then delete the file "rename.doc"
b'coz it has also been renamed from "rename.bat" to "rename.doc"........


0

Related Posts

See More



Response Number 6
Name: DAVEINCAPS
Date: June 10, 2009 at 23:42:28 Pacific
Reply:

That won't create the double extension the OP wanted:

XXX.1 to XXX.1.doc

And why would you need a batch file to do it anyway?


0

Response Number 7
Name: Hansum Krishna
Date: June 12, 2009 at 01:02:54 Pacific
Reply:

its so simple "DAVEINCAPS"
if you want double extension, just edit your bat file with following.....

===

@echo off
ren *.* *.*.doc

===

got it.....??? "DAVEINCAPS"...............

=============
hAnSuM KrIsHnA
-a bLACK hAT hACKER
'N'
-a pRO cRACKER
...........................


0

Response Number 8
Name: DAVEINCAPS
Date: June 12, 2009 at 11:51:47 Pacific
Reply:

So, you mean kind of like what I pointed out in my #2 above? I used ? instead of * in order to isolate the files he wanted changed. It's so simple!

But again, why do you need a batch file? Writing a batch file to run a single command is silly. Just run the command from a prompt and be done with it.

Get it??


0

Response Number 9
Name: Hansum Krishna
Date: June 14, 2009 at 06:48:54 Pacific
Reply:

K.......I accept my mistake........i m a kid 'n' i m new in dos.....k..??.....

=============
hAnSuM KrIsHnA
-a bLACK hAT hACKER
'N'
-a pRO cRACKER
...........................


0

Response Number 10
Name: DAVEINCAPS
Date: June 14, 2009 at 13:07:36 Pacific
Reply:

Well, for a kid you're doing pretty good. You'll learn a lot in these forums even if you don't contribute.


0

Sponsored Link
Ads by Google
Reply to Message Icon





Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Renaming multiple files

Rename multiple Files www.computing.net/answers/dos/rename-multiple-files/14239.html

Renaming Multiple Files www.computing.net/answers/dos/renaming-multiple-files/13297.html

Renaming multiple files www.computing.net/answers/dos/renaming-multiple-files/15167.html