Get IT Solutions

How to do IT
Menu
  • Home
  • SCCM 2012
    • Deploy Packages
    • Troubleshooting errors SCCM 2012
  • Windows
    • Applications Silent Install
    • Windows Tools
    • Windows Error
    • Script
    • Exchange Server
    • Troubleshooting Office
    • Applications Errors
  • Database
    • SQL Server
    • MySQL
    • Oracle
  • Cybersecurity
  • Other
  • Reviews

Change extension of multiple files at once – CMD batch file

The following article will teach the methods to change the extension of multiple files at once using command prompt and batch file. Furthermore, we will explain the methods of using Powershell tools. In the end, w will recommend some tools to make the job easy.

About filenames

Windows Filenames are created from two parts, a filename, and an extension. They are separated by a full stop (a period). The filename is a descriptive label; the extension indicates the type of file you’re dealing with – PNG for an image, MP4 for a video file, DOC or DOCX for Word documents, PDF for an Adobe Reader file, and so on. You’re can change filenames as you need, but you need to know before changing file extensions because Windows uses the extension to figure out which program should be used to open a file.

 

How to display file extensions:

By default the extension on windows explorer is disabled and you cannot see it if you don’t change the below settings:

  1. Open any folder window.
  2. Press Alt+T+O (that’s the letter O, not a zero) to open the Folder Options dialog box.
  3. Click the View tab.
  4. Remove the tick (checkmark) beside ‘Hide extensions for known file types’ and click OK.

You need to know before making any change that you cannot rename a file extension and change the type of a file. For example, you cannot rename a file with a “.txt” extension to a “.png” and make it an image. If you want to change the file type, you need to convert the file. With a “.exe” file and other file extensions, you may need to use a program to create the file.

 

Table of Contents

  • How to change extension of multiple files at once using File Explorer
  • Batch rename file extensions in bulk from CMD
    • How to rename the single file extension
    • How to rename a single file extension with the move command
    • How to rename multiple file extension
    • How to rename a file extension keeping the original
    • Recursively batch rename file extensions
    • How to remove file extensions in batch
    • How to create a batch to rename file extensions in bulk
  • Change extension of multiple files at once using PowerShell
  • Bonus Solution to play with the file names
    • How to trim multiple file names
    • How to Add prefix to file names in batch
    • How to Handling names with white spaces
  • Change extension of multiple files using Bulk Rename Tools
  • Renaming in Linux
  • Conclusion:

How to change extension of multiple files at once using File Explorer

Change file extension for one file in Windows 10:

In Windows 10, make sure file extensions are visible using the steps above, then:

  1. Click the file to select it, then click once more. Windows automatically selects the filename so that anything you type will replace the existing name.
  2. Click and drag over the extension, type the new extension, and press Enter.

It sounds simple enough, but imagine if you’re changing extensions on a bunch of files? Things get even worse if you want to change capitalized extensions on a group of files: Windows 7 cannot do it. For example, if you have three files named Test1.JPG, Test2.JPG, and Test3.JPG, if you select all the files and rename the first one Testing.jpg, you’ll end up with Testing (1).JPG, Testing (2).JPG and Testing (3).JPG. The extension pigheadedly maintains its uppercase lettering. If you want to change those extensions, you have to rename each file one by one. Let’s see the example below:

 

Change file extension for multiple files at once:

Just put all the files which you would like to rename, in a single folder (if they are scattered). Follow these steps and you can quickly rename all files at once in File Explorer:

  1. Open File Explorer in Windows 10 and browse to the folder where the files you need to rename.
  2. Press Ctrl +A to select all your target files. Once all the files are selected, right-click on the first file and select rename from the context menu (you can also press F2 to rename the file).
  3. You’ll notice only the file name itself is highlighted, not the extension. If you want to rename the full name including extension, press Ctrl + A to select all. Now type a new file name and press Enter.
  4. It will rename the rest of the files based on the first filename, and add the sequential number to the end of each file.

To make the things sample, come in play the command line where you can play and change the extensions easier. Read below!!!

 

Batch rename file extensions in bulk from CMD

Command-line (CMD) is a powerful tool where you can change many things and automate daily processes like deleting specific files. In this article, we will use it to rename file extensions in bulk.

First open a command prompt by:

  1. Searching on windows the “cmd” name an open as administrator
  2. Navigate to your path where you need to change the extension by type cd and the path
  3. Click Enter

You are now located in the directory/folder where are the files need to change the extension.

  • How to rename the single file extension

If you are only want to rename a single file and extension, you can specify the full file name and file extension as shown.

rename Test1.txt Test1.html

In the example above, the “Test1.txt” text file would be renamed to “Test1.html”.

  • How to rename a single file extension with the move command

Like using the rename command, you can also use the move command to rename a file as shown.

move Test1.txt Test1.html
  • How to rename multiple file extension

If you want to rename the extensions without keeping the original file, you can also use a command similar to the following example.

rename *.shn *.wav

The above command will change the extension of all files from .shn to .wav

ren *.* *.newextension

The above command will change the extension of all files no matter what is the extension to the new one .newextension

  • How to rename a file extension keeping the original

Use the following command at the Windows command line or within a batch file.

xcopy *.shn *.wav

The command will create a copy of the original files with the new extension.

READ ALSO -   How to Create Batch to Delete File Automatically – Command Line(CMD)
  • Recursively batch rename file extensions

The following command will rename files from one extension to another, in all subfolders:

forfiles /S /M *.ext1 /C "cmd /c rename @file @fname.ext2"

or

FOR /R %f IN (*.kar) DO REN "%f" *.mid

For example, if you want to rename all jpg files to png files, the command would be as below:

forfiles /S /M *.jpg /C "cmd /c rename @file @fname.png"
  • How to remove file extensions in batch

The below command would remove the extension for the specified file types. In our example we will remove the .jpg extension from all files in the folder and subfolders:

forfiles /S /M *.jpg /C "cmd /c rename @file @fname"
  • How to create a batch to rename file extensions in bulk

If you are going to automate the above activities or to execute over the network you will need to create a batch file:

  • Open a notepad file
  • Copy the below command
@echo off
Cd C:/Test
forfiles /S /M *.jpg /C "cmd /c rename @file @fname.png"
  • Save as changeextension.bat
  • Execute the file and all the .jpg files on C:/Test will be changed to .png

Be careful when executed the batch over the network. Be Sure that C:/Test is the path where you need to make the changes as the command will change all the file extension in the folder and subfolders. If you want to change only on the folder you need to replace the command with :

rename *.shn *.wav

 

Change extension of multiple files at once using PowerShell

You can change/rename the extension of a file or multiple files using the ChangeExtension method:

  1. Open Start.
  2. Search for PowerShell and click the top result to open the app.
  3. Type the following command to rename a single file extension and press Enter:
Rename-Item -Path 'C:\Test\Test01.txt' -NewName $([System.IO.Path]::ChangeExtension('C:\Test\Test01.txt', ".old"))
  1. Type the following command to rename multiply file extension:
Get-ChildItem -Path C:\Test -Filter *.txt | Rename-Item -NewName {[System.IO.Path]::ChangeExtension($_.Name, ".old")}

 

Bonus Solution to play with the file names

  • How to trim multiple file names

You might want to make the file names shorter and bring more simplicity to the equation. Here is how to trim multiple names simultaneously.

For instance, you may have .jpg files that need trimming with names that have already been customized. Inside the target directory, you can add the “ren*.* ??????.*” function. This function will trim the original photos to the number of characters designated by the question marks.

This example will turn a file named “mountain_trip.jpg” into “mounta.jpg.” Of course, if the file name is six characters or less in length, it will remain the same. This is useful where short file names are a better option than long ones.

  • How to Add prefix to file names in batch

If you want to add any prefix to file names, it can be done as in the below example. Here we try to add ‘photo’ to every jpg file in the current folder and subfolders.

forfiles /S /M *.jpg /C "cmd /c rename @file photo@file"

Similarly, we can add a number to a file name.

forfiles /S /M *.jpg /C "cmd /c rename @file 99@file"
  • How to Handling names with white spaces

If the new name you want to assign to the files has white space within it, it can be done by adding double quotes around the file name. So that forfiles does not misinterpret these double-quotes, you need to escape them with ‘\’

For example, to add ” – pic.jpg” to each of the jpg files, the command would be as below.

forfiles /M *.jpg /C "cmd /c rename @file \"@fname - pic.jpg\""

 

Change extension of multiple files using Bulk Rename Tools

A better way to change filenames and extensions is to use tools. If you need to do some serious file renaming, try a bulk file renaming utility. Bulk Rename Utility is free to use. It has enormous power and flexibility, it makes very light work out of actions such as changing the case of a bunch of file extensions. If you want a less intimidating renamer, Better File Rename does the trick, but it’ll cost $US19.95.

Below is the guide on how to change the case of all files in a folder using Bulk Rename Utility:

  1. Open the folder containing the files.
  2. Right-click any file in the folder and choose Bulk Rename Here from the context menu. The utility will load all the files into its main window, with a folder tree displayed on the left allowing you to navigate to any other folder, and a mind-numbing array of options displayed below.
  3. Press Ctrl+A to select all the files in the folder.
  4. Down near the bottom right of the window you’ll see Extension. Select Lower from the Extension drop-down box. You’ll see the filenames updated in the New Name column. This is a preview to let you check whether the changes you’re making are correct.
  5. If you’re satisfied with the displayed changes, click the Rename button in the bottom right to rename the selected files.

 

Renaming in Linux

In the Linux command line, you can rename a file and file extension by using the mv (move) command as shown.

mv Test.txt Test.html

In the example above, the “Test.txt” text file would be renamed to “Test.html”.

 

Conclusion:

This is all about methods to change the extension of multiple files at once. If you have any suggestions feel free to comment below.

Share
Tweet
Google+
Pinterest
Linkedin
Stumble
Email
Prev Article
Next Article

Related Articles

Three different ways on how to export and import scheduled tasks
Dear followers of Get-ITsolutions.com, as you may now we have …

Three different ways on how to export and import scheduled tasks

Following our script series we will explain in this tutorial …

Forfiles script to delete files older than 7 days – Command Line

Best Computers & Laptops

Best Computer for Cyber Security – Laptop and Desktop
Best Computer for Cyber Security
Hey, are you seeking the best computer for cyber security? Well, we must say you have come to the right place to find your answer and guidance. There are a plethora of products out there for you to pick from ...
Read More
Best Computer for Microsoft Office & Excel – Laptop and Desktop
Best Computer for Microsoft Office & Excel
Are you finding the Best Computer for Microsoft Office and Excel? In modern days, the best laptop or desktop set is the one which is both portable, has good looks and offers the smoothest performance. Microsoft Office is a package ...
Read More
Best Computer for Hacking – Laptop and Desktop Selection
Best computer for Hacking
When it comes to hacking, either laptop or desktop, choosing the best computer for hacking would be an exhilarating job. There are many specifications to be considered for hacking ...
Read More

SQL Server Tips

FIX sqlstate 42000 – mysql error 1064 – you have an error in your sql syntax
Sqlstate 42000 Is a general code that come together with other number. Most often comes with the code 1064 and ...
Read More
The execute permission was denied on the object – SQL Server Error
The execute permission was denied on the object
The following article will handle “the execute permission was denied on the object” error appears on SQL Server. This error ...
Read More
How to Read Data from LDF file in SQL Server – A Complete Guide
Read LDF File
Hello Everyone, Today we are going to address the most popular query of SQL users, how to read data from ...
Read More

Search

We are on:

Get FREE SPACE for your PC

3 Method to Delete Temp Files in Windows 7/10 including vbs script

In this post we will explain how to delete temp files windows 7 using three different methods including vbs script ...
Read More

Fastest way to delete hiberfil sys from windows 10/8/7 and XP – CMD

In this article we will explain how to remove or delete hiberfil sys from Windows 10/8/7 and XP . If you does ...
Read More

Learn How to Silent Install Applications

Silent Install Adobe Flash Player
In this tutorial will explain how to silent install adobe flash player 25, Msi and Exe version. How to disable auto update and uninstall older ...
Read More
Java Silent Install and Uninstall Older Version – Deploy Package MSI
This tutorial will explain how to silent install Java MSI/EXE version and disable auto-update. The command line will also uninstall the ...
Read More
Silent Install Adobe Shockwave Player 12 and disable update
In this tutorial will explain how to silent install Adobe Shockwave Player 12 msi and disable auto update. The command will uninstall older ...
Read More
Silent Install Google Chrome MSI, Silent Uninstall and Disable Auto Update
This tutorial will explain how to silent install Google Chrome MSI and disable auto update. The command will uninstall older version of ...
Read More
Silent Install Adobe Reader 11 and DC – msi and exe – disable update
In this tutorial will explain how to silent install Adobe Reader version 11 and DC. We will user both version "msi" ...
Read More
Silent Install Mozilla Firefox msi and exe file – Including Silent Uninstallation
This tutorial will explain how to silent install Mozilla Firefox. We will use MSI and EXE files to perform a silent ...
Read More
Skype Silent Install Msi and disable updates
In this tutorial will explain how to silent install skype  and disable auto update. The command will uninstall older version of Skype and ...
Read More
Filezilla Silent Install msi and exe version
Filezilla silent install tutorial will explain how to perform a silent installation of application. We will explain methods, silent install ...
Read More
Silent install VLC Media Player
In this tutorial will explain how to silent install VLC Media Player. We will explain both methods for exe and ...
Read More
Notepad++ silent install exe and msi version – Command Line
Notepad++ silent install is the new article from a series of silent installations. Notepad++ as free software has two main ...
Read More

Batch File Solutions

How to list files in cmd – Command Prompt – Windows 10
Whenever you want to search and make a list of all files on a specific folder, you used the windows ...
Read More
Batch rename multiple files in folder – CMD script – Bulk Method – Win 10
The following article will teach how to rename multiple files in a folder with the bulk method using Command Line ...
Read More
Batch script rename file using Command Line (CMD) & PowerShell – Windows 10
The following article will use the “rename” or “ren” command to rename the file using a command prompt. Also, we ...
Read More
Change extension of multiple files at once – CMD batch file
The following article will teach the methods to change the extension of multiple files at once using command prompt and ...
Read More
How to delete registry key with command line | PowerShell | Batch
The following article is the third of series about registry and working on it through command line (CMD) and PowerShell ...
Read More
How to add registry key & values with CMD | PowerShell | Batch
The registry is the place where most of the applications store the settings but not only. Used also from the ...
Read More
Unmap Network Drive CMD – (Batch file) – net use delete command
After we posted the methods to map network drive using cmd commands we come this time with the method to ...
Read More
Map Network Drive cmd (batch file) – net use user password
This article will focus on another way to map a network drive on your computer instead of from the explorer ...
Read More
How to Find Large Files on Windows 7 & 10 – CMD Forfiles Command
If the capacity of your hard drive is running low, it is time to clean off some files and to ...
Read More
CMD Script to check disk space on windows and multiple remote servers
The following article will provide you script to check disk space. The Script monitor space on windows and multiple remote ...
Read More

Get IT Solutions

How to do IT

About Us

Get IT Solutions is a personal blog, which is managed to guide people for various topic.

Second Menu

  • Donate
  • About Us
  • Contact Us
  • Privacy Policy

What Will You Find

Automation is our area of writing where are included scripts, batch and various tips to automate your daily job.
Copyright © 2025 Get IT Solutions