Home Tech Guides How to Batch Rename Multiple Files in Windows

How to Batch Rename Multiple Files in Windows

How to Batch Rename Multiple Files in Windows
How to Batch Rename Multiple Files in Windows

Do you have a lot of files you want to rename but don’t want to go through them all one by one? You may not be aware of how many options Windows offers for this.

With Windows Explorer alone, you can rename one or more files with ease, but the Command Prompt or PowerShell can do considerably more. The possibilities are unlimited if you include third-party renaming tools. Let’s examine how each choice functions before moving on.

Several Files in Windows Explorer Can Be Rename

It’s astonishing how strong Windows Explorer is (formerly call File Explorer in Windows 10). Most likely, you already know how to rename a single file, but let’s start with the fundamentals as the more sophisticated techniques build on them.

 

You can choose a file’s name and rename it in at least three different methods while using the mouse. You could:

Click to pick the file, and then on the Home menu, select “Rename.”
Click the file to be select, and then click the file’s name.
Rename the file by choosing it from the context menu when you right-click it.

2 8

If you’d rather stick using your keyboard, you may simply choose a file using the arrow keys (or by starting to type the file name) and then press F2 to choose the file name.

You can type a new file name after the file name has been select.You’ll note that only the file name has been picked; the extension has not.

3 8

When you’re finish, you can hit Enter to save the new name or simply click somewhere else.

 

When you press the Tab key, the following file name in the folder will be automatically select. Allowing you to start creating a new name for it right away. This is where things get interesting. If you want to, you can quickly rename every file in a folder by continuing to hit Tab and typing names in this manner.

A simpler method to batch rename files in Windows is available if you’re renaming a number of files in the same folder but they don’t all require fully unique names. To pick numerous files at once, hold down the Ctrl key, or use the Shift key to select a range of files, to begin by selecting a large number of files. The Home menu button, the context menu command, or simply pressing F2 are all available renaming options once the files have been selected. You’ll notice that while all of the files are still chosen, the name of the first file in the group is highlighted so you may input a new name.

4 7

After giving the file a new name, press Enter or click anywhere else in the window. All of the chosen files are renamed with the name you just specified, and a number is added to the end of the name to help you distinguish between them.

5 7

Use the Command Prompt to Rename Multiple Files

Using the rename or ren command in a Command Prompt window to one or more files can provide you more control if you require it. Wildcard symbols such as * and? are permitted in the command. for multiple file matching, which is useful if you simply want to rename a specific subset of the files in a folder with lots of them.

Opening the folder in File Explorer is the quickest approach to get a Command Prompt window where you want it. Choose “Open command prompt” from the “File” menu by pointing at “Open command prompt” and clicking on it.

6 5

You can use the following command syntax to rename a single file:

7 1

If your file names include any spaces in them, the quotations are crucial. If not, the quotations are not necessary. You would use the following command, for instance, to rename a file from “wordfile (1).docx” to “my word file (01).docx”:

8 1

9

The ren command’s ability to address extensions also allows you to use it to simultaneously change the extensions of several files. Consider a scenario in which you wished to convert a number of.txt files into.html files. The * wildcard (which essentially instructs Windows that text of any length should be consider a match) might be used in conjunction with the comman below:

10

While we’re talking about wildcards, you can also use the to do some fascinating things. wildcard, which can replace any single character. Imagine if you wished to convert a large number of.html files into.htm files as an example. To make the modification, you could issue the following command:

 

11

This instructs Windows to rename all files with the.html extension using the same file name and the same first three letters of the file extension only. As a result, all extensions in the folder have their “l”s remove.

The command line wizardry you can engage in to create more complex commands—or even batch scripts—by incorporating other commands and conditionals into things is only just getting started here. The people who run the Lagmonster forums have a fantastic article on the matter if you’re interested.

Using PowerShell, rename several files

For renaming files in a command-line context, PowerShell provides considerably more versatility. Similar to how you do on Linux and other UNIX-like systems, PowerShell allows you to pipe the output of one command, or “commandlet,” to another command. You’ll want the two crucial commands Dir and Rename-Item to rename an item and list the files in the current directory, respectively (a file, in this case). You can now proceed by piping the output of Dir to Rename-Item.

By opening the folder in File Explorer first, you can quickly open a PowerShell window where you want it. Choose “Open Windows PowerShell” from the “File” menu by placing a cursor over it.

12 1

Let’s start by looking into renaming a single file. The following syntax would be used for that:

13 1

So you would use the following commandlet, for instance, to rename a file from “wordfile.docx” to “My Word File.docx”:

14 1
15

Quite simple. The ability to pipe commandlets together and some of the conditional choices allowed by the rename-item commandlet, however, are what give PowerShell its true strength. Suppose, for instance, that we had a number of files with the names “wordfile (1).docx,” “wordfile (2).docx,” and so forth.

16

Let’s say we wanted to remove the space from the file names and replace it with an underscore, making the file names space-free. The commandlet below could be used:

17
18

All of the files in the folder are list in the dir portion of that commandlet, which pipes them (the | symbol) to the rename-item commandlet. All of the files that are being piped are represented by the $_.name portion. The -replace switch denotes the presence of a replacement. The remainder of the commandlet simply instructs the user to substitute an underscore (“_”) for any spaces (“”).

Our files now seem the way we want them to.

19

We’re only touching the surface of the capabilities that PowerShell has to offer when it comes to naming your files, as you might anticipate. For instance, the rename-item commandlet includes features like the –recurse switch, which can apply the commandlet to files in a folder and all folders neste inside that folder, the -force switch. Which can force renaming for files that are locked or otherwise unavailable, and even the –whatif switch, which explains what would happen if the commandlet was execut (without actually executing it). Naturally, you can also create more intricate commandlet structures that even incorporate IF/THEN logic. Our Geek School guide has additional information on PowerShell in general, and the Microsoft TechNet Library has more information on the rename-item commandlet.

Using a Third-Party App to Rename Many Files

You can always use a third-party program if you need a strong technique to rename many files simultaneously. But aren’t interest in learning how to use the Comman Prompt or PowerShell commands.

 

Utilizing the Bulk Rename Utility

Although the interface of Bulk Rename Utility is crowd and a little intimidating. It exposes the vast array of choices that are typically only available through the use of command-line parameters and regular expressions.

After setting up the tool, run it, choose the files you want to rename, and then go to them.

20

A preview of your modifications will appear in the “New Name” column where your files are list. When you alter options in one or more of the numerous accessible panels. To make it clearer what I’ve altere, I’ve added modifications to four of the panels in this example, which are now marke in orange. All files now have the name “Word File,” and title case is how I instructed the software to rename them. The file’s creation date in YMD format is attach. Additionally, I’ve added a file number that automatically generates at the end of the file name, starts at 1, increases by 1, and is separate from the file name by an underscore. The Bulk Rename Utility allows you to do much more than that.All you have to do is click the “Rename” button when you are happy with the way your new file names will appear.

21

You can see that the tool processed my straightforward requests with ease.

22

How to Use AdvancedRenamer

Our other favorite renaming tool, AdvancedRenamer, exposes a vast variety of renaming ways as well, but instead of displaying them all as panels in the UI, it requires you to develop renaming methods using a rather straightforward yet effective syntax. They provide good help, examples, and it’s not difficult to learn. The utility does come with a noticeably friendlier user interface, and it enables creating sophisticated batch tasks so you can mix several renaming techniques and use them on a huge number of files. You can also store your own renaming techniques for use at a later time.

I’ve developed a renaming mechanism in the example below using the syntax:

23

This instructs AdvancedRenamer to add the creation date in the YMD format to all of my files and to rename them all “Word File” (separating each portion by an underscore). In parentheses and separated by an additional underscore, it additionally inserts an incremental file number.

24

And as you can see, I’ve given my files the names I wish. Although AdvancedRenamer has a slightly more difficult learning curve than Bulk File Renamer, the payoff is that you have considerably more control over your file names.

25

Were there any additional approaches to renaming files in Windows that we missed? Make sure to inform us of it by leaving a comment on this page.

 

 

 

 

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.