How to change the file extension using cmd script

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"





About Sher khan

Senior Oracle DBA, Oracle 10g , Oracle 11g OCE ,Oracle 12C and Oracle 11g OPN certified Specialist, OCP Certified in Oracle 9i,10g , 11g and 12C. I am working in Oracle technology since 2004. Currently working in U.A.E Email:
Image | This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s