Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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".

share|improve this question

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

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

add comment

2 Answers 2

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.

share|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
add comment

Try: ren Filename1.drg* Filename1.drg

It works for me.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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