To change the files extension in once using script its very easy. I need to change the multiple files extension , it was difficult to change one by one. So I created a script to change at once and reuse it.
I create a files in D:\test\a.html and a.bat
After that I run the script one time for html format files and 2nd time for bat file. You assume those are multiple file not single.
forfiles /S /M *.bat /C "cmd /c rename @file @fname.txt" forfiles /S /M *.html /C "cmd /c rename @file @fname.txt"