windows rename command to rename file.a.b to file.b

Posted by sakibmoon on Super User See other posts from Super User or by sakibmoon
Published on 2012-10-31T04:29:37Z Indexed on 2012/10/31 5:08 UTC
Read the original article Hit count: 599

Filed under:
|
|
|

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? Currently it can't run those files.

Thanks in advance.

© Super User or respective owner

Related posts about windows-7

Related posts about command-line