How to Rename File Extensions with Command Prompt

In this article, you will learn the way to change / rename file extensions in windows with command prompt.

Question:

Suppose you have a folder in which thousands of .TXT file exist and you want to change their extension to .XLS. How to change the extension?

Answer:

There are two ways to change / rename a file extension:

  1. Rename a single file extension
  2. Rename multiple files extension in bulk

Step-1:

Open command prompt > Go to the folder in which your file exist.

  • C:\Users\Administrator\Desktop> CD Test
  • C:\Users\Administrator\Desktop\Test
  • C:\Users\Administrator\Desktop\Test> Dir
  • C:\Users\Administrator\Desktop\Test> ren Sample-1.txt Sample-1.xls

In this example, I have used ren Sample-1.txt Sample-1.xls command.


You can see the result in below snapshot.

Rename File Extensions


Step-2:

Open command prompt > Go to the folder in which your file exist.

  • C:\Users\Administrator\Desktop> CD Test
  • C:\Users\Administrator\Desktop\Test
  • C:\Users\Administrator\Desktop\Test> Dir
  • C:\Users\Administrator\Desktop\Test> ren *.txt *.xls

Either you can run ren *.txt *.xls command on command prompt or you can write this command in batch file as shown in below snapshot.

Put this batch file in the same directory where your files exist. Just double click on the batch file and you are done.

By this way all .txt files in the directory will be changed to .xls file.

Rename File Extensions

You can see the results in below snapshot.

Rename File Extensions

By this way you can change file extensions of all the files in a folder.

Get Free Blogging Tips & Technology updates in your Email !!!

Subscribe via RSS feed

The following two tabs change content below.
Anil Kumar
IT Blogger Tips focus on Blogging Tips, SEO Tips, Social Media, SQL Tips, PL/SQL Tips, Oracle DBA, Linux/Unix, Latest Technology, How Tos and Technical Solutions. You can find us on Facebook | Twitter |
Find on Google+

Siteground SALE
60% OFF SiteGround WordPress Hosting – $3.95/month (Exclusive Offer !!!)