I have multiple files in a folder in below format.

"Filename1.drg.txt"

I want this to be changed to "Filename1.drg". How can I do that in command prompt?

I tried ren *.drg.txt *.drg. It changed them to "Filename1.drg.drg".

link|improve this question
feedback

migrated from stackoverflow.com Jul 12 '11 at 1:24

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 1 down vote accepted
ren *.drg.txt *.

Will rename all files that end on .drg.txt by removing the extension. On this case, preserving .drg. Which is what you want I presume.

link|improve this answer
Yes. This is what I want it. – user839765 Jul 12 '11 at 3:14
It helped. Thanks a lot. – user839765 Jul 12 '11 at 16:19
feedback

Try: ren Filename1.drg* Filename1.drg

It works for me.

link|improve this answer
it changed the file name to Filename1.drg.drg – user839765 Jul 12 '11 at 3:20
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.