Home » How To » How To Bulk Rename File Extensions in All Folders in Windows 10

How To Bulk Rename File Extensions in All Folders in Windows 10

Need to bulk change file extensions? This article shows how to bulk rename file extensions in Windows 10 and 11 operating systems.

From time to time, I find myself wanting to rename the file extension of a specific file type. Changing a file extension with File Explorer is as simple as renaming a file. It’s nothing difficult if it’s just a couple of files. But what if you want to rename the file extensions of multiple files at the same time? It would be best if you had something better.

So, if you are ever in that situation, follow the below steps to recursively bulk rename file extensions.

How to bulk rename file extension in a folder

There are several software out there that let you rename files and file extensions. This guide shows how to use a built-in command to rename the file extension of all files in a folder and all its sub-folders.

As you’d expect, to bulk rename file extensions in all folders, the command should be able to target file types in all sub-folders in the target folder and rename. The good thing is that though it sounds complicated, it is pretty straightforward. Let me show you how.

  1. Open the Start menu.
  2. Search and open “Command Prompt.”
  3. Run the below command to go to the folder.
    cd "D:\Path\To\Folder"
  4. Use the below command while replacing .ext1 and .ext2 with actual extensions.
    for /R %x in (*.ext1) do ren "%x" *.ext2
  5. With that, the command renames the file extensions.
  6. Close the Command Prompt window.

Steps with more details:

First of all, search for Command Prompt in the start menu and open it. Windows 11 users can open the Terminal and select “Command Prompt” from the title bar dropdown menu.

open Command Prompt to bulk rename file extensions

If the files you want to rename are in the C drive, skip this step. Otherwise, use the below command to go to that drive. Don’t forget to replace “<DriveLetter>” with the actual drive letter. In my case, I’m navigating to the D drive.

 <DriveLetter>:

Next, use the below command to go to the folder where the files are located. Replace the dummy path with the actual folder path.

 cd "D:\Path\To\Folder"

A quick tip: Drag and drop the folder into Command Prompt to autofill the folder path.

The command we are going to use will rename the extensions of all target files in this folder and all its sub-folders. As such, create a backup of all files, if necessary.

Once you are inside the target folder, execute the below command while replacing “ext1” with the current file extension and “ext2” with the new file extension.

for /R %x in (*.ext1) do ren "%x" *.ext2

For example, if I’m trying to change the file extension from JPG to PNG, the command will look like this.

for /R %x in (*.jpg) do ren "%x" *.png

As soon as you execute the command, the Command Prompt will go through the current folder and all its sub-folders and bulk rename file extension.

Once that is done, close the Command Prompt window.

That is all. It is that simple to bulk rename file extensions in Windows.

I hope this simple and easy Windows how-to guide helped you.

If you are stuck or need help, send an email, and I will try to help as much as possible.

If you like this article, check out how to delete files using Command Prompt in Windows.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top