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

Possible Duplicate:
windows rename command to rename file.a.b to file.b

I have a few folders with hundreds of html files. The file name should have been .htm but it is .asp.htm and it does not run. It is plain html file and there is no asp code.

So, I tried to rename the files using rename command. I tried like this:

rename *.asp.htm *.htm

But it does not work. After trying a few other combinations I believe rename or ren command can't change the double dot extension. The only change the last extension. So, if I try:

rename *.asp.htm *.asp.htm

I thought nothing would be changed, but the file name changes from file.asp.htm to file.asp.asp.htm

I hope someone would help me with this. Another thing is: can I force apache to run files with .asp.htm extension?

share|improve this question

migrated from Oct 31 '12 at 5:28

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

marked as duplicate by Sathya Oct 31 '12 at 6:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

This is not a programming question. SuperUser is a better venue. – Raymond Chen Oct 31 '12 at 4:05
Thanks. I will ask there. – sakibmoon Oct 31 '12 at 4:19
Don't, this question will be migrated. – mnel Oct 31 '12 at 4:25
Sorry, But I already asked there. What should I do now? – sakibmoon Oct 31 '12 at 4:37
up vote 1 down vote accepted

You can do it with two ren instances:

ren *.asp.htm *. (this will change the extension to .asp)

And after:

ren *.asp *.htm

share|improve this answer

There are some file renaming softwares available for free. Try them. Some of them I'll suggest you is BullRenameUtility and Multi File Renamer

share|improve this answer
I believe my problem can be solved with a single rename command. So, I don't really want to try them. Thanks anyway. They might come in handy in future. – sakibmoon Oct 31 '12 at 4:36

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