Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

up vote 2 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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .