How To'sWindows

These Are 4 Ways to Batch Rename Files in Windows

You’ve got a handful of files you want to rename, but you don’t want to spend the time going through them one by one. You may not be aware of how many different ways Windows provides to accomplish this.

You can rename files through Windows Explorer, but you can also use the Command Prompt or PowerShell. With third-party renaming tools, the options are unlimited. Let’s explore each option’s functionality.

1. Rename Multiple Files Using File Explorer

Windows Explorer (known as File Explorer in Windows 10) is a lot more powerful than most people think it is. How do you rename one file? You probably already know how to do this, but let’s start with some basics first.

You can use File Explorer to rename files, but this method has limitations since you cannot modify file extensions (.txt) or stop Windows from adding numbers. Advanced functions require the command line and Windows PowerShell.

For example, I wanted to rename a list of text files from Numeric digits to something else. First, Second.. in this scenario. This approach keeps items organized, such as project files or anything.

There are at least three ways to do this:

Method #1

  • Select the file and then click on the “Rename” button.

Method #2

  • Right-click the file and then select “Rename”.

Method #3

To batch rename files you have to select all files and press F2 and press enter to rename the file. To keep renaming you have to press the Tab key to automatically select the next file so you can easily rename it.

2. Rename Multiple Files Using Command Prompt

The command prompt is great for batch renaming just extensions in Windows. Files can be renamed. First, let’s change extensions.

  1. First, open a command prompt (Win + R) and type cmd, and enter.
  2. After opening CMD you need to change the directory where the files are located. You can copy the complete path through File Explorer.
  3. Then on the CMD, you can simply type cd "C:\Users\Noor\Desktop\New folder"

Rename a single file using this syntax:

ren "original_filename.extension" "renamed_filename.extension"

To rename a file from .txt to .doc you can use the following command:

ren "First (5).txt" "First (5).docx"

Because the ren command may address extensions, it can also rename several files at once. Say you wanted to convert a bunch of .txt files to .docx. You could use the * wildcard to notify Windows that text of any length should be considered a match:

ren *.txt *.docx

However, if the file names contain numerous characters, you may get a duplicate file error. Use wildcards (question marks) to maintain a unique piece of the original name.

ren *.filenameext ???name.filenameext
ren *.txt ??????????Date.txt

3. Rename Multiple Files Using Command Prompt

PowerShell gives you even more options for renaming files in a command-line environment. Pipe the output of one command to another command, just like on Linux and other UNIX-like systems. This is how PowerShell works.

Like on Linux and other UNIX-like systems, pipe the output of one command to another. Using PowerShell, this is how it works.

Launch the required folder in File Explorer first, and then open a PowerShell window. Windows PowerShell can be opened from the File menu by selecting “Open Windows PowerShell.”

Let’s start with a simple example: renaming only a single file. You’d use the following syntax for that:

rename-item "original_filename.ext" "renamed_filename.ext"

If we wanted to remove the spaces from the file names, we could use an underscore instead. Using the commandlet, we can do it.

dir | rename-item -NewName {$ -replace " ","_"}

“dir” will list all the files and pip them with rename-item commandlet same like Linux/Unix, and -replace keyword will do the replacing. And (” “) signifies the space in filenames which should be replaced with (“_”) underscore.

You can clearly see it has replaced spaces with the underscore. Also, read more about this documentation here.

4. Rename Multiple Files Using Third-Party App

To rename files and documents at once, you can use a third-party program instead of the Command Prompt or PowerShell methods. If you’re looking for a program to help you rename your files, you can’t go wrong with Bulk Rename Utility, PowerToys, or AdvancedRenamer.

William Keener

William is a tech writer at Hacktoday. He's been writing how-to guides for about 4 years now and has covered many topics. He loves to cover topics related to Windows, Android, and the latest tricks and tips.

Related Articles

Back to top button