-->

Batch Rename Multiple Files on Windows | Try out how to do it.

How to Batch Rename Multiple Files on Windows

 Have a lot of files that you want to rename, but don't want to rename them one by one? Windows provides many more ways to do this.


You can easily rename one or more files with just Windows Explorer, but you can do a lot more with the Command Prompt or PowerShell.


Rename Multiple Files with Windows Explorer


You may know how to rename a single file from Windows Explorer (known as File Explorer in Windows 10), but let's see how to rename multiple files with this.


If you're using a mouse, you have three ways to choose to select a filename and then rename it:

  * Click to select file and then click “Rename” on the Home menu.


  * Click to select file and then click the name of the selected file.


  * Right-click the file and then select “Rename” in the context menu.


650x420xwrn_1-650x420


And if you prefer to use the keyboard, you can just use the arrow keys (or start typing the file name) to select a file and then press F2 to select a file name.


After you select the selected file name, note that only the file name is highlighted, not including the final extension. Then you can start typing the new file name.


index


When you're done typing, press Enter to save the new name.


You can also press the “Tab” key to automatically select the name of the next file in the folder so you can immediately start typing a new name for the next folder. Keep doing this and you can easily rename all the files in the folder.


If you want to rename multiple files in the same folder and the files don't need to be too different from each other, Windows provides an easier way to batch rename files. The method:


1. Select a group of files that you want to rename (you can hold down the Ctrl key to select multiple files at once, or Shift to select multiple files).


2. Once all files are selected, press the rename command on the Home menu (or you can select “Rename” in the context menu or just press F2).


3. You will see that all files remain selected, but the name of the first file is highlighted so you can type a new name.


474x177xwrn_3


4. Type a new name for the file and then press Enter. All selected files will be renamed using the name you typed, only the back end is added with a number in parentheses to distinguish each file.


473x174xwrn_4


Rename Multiple Files with Command Prompt


If you need something more than that, you can also use the rename or ren command in the Command Prompt. Command accepts characters like * and ? for matching multiple files, this can be helpful if you just want to rename a select selection of files in a full folder.


1. The fastest way to open Command Prompt from a folder is to open the folder in File Explorer. From the “File” menu, point to “Open command prompt,” and then select “Open command prompt.”


543x317xwrn_5


2. To rename a single file, you can use the following command syntax:

ren "current_filename.ext" "new_filename.ext"


3. Quotation marks are very important if your file name contains spaces. If not, then there is no need for quotes. So, for example, to rename a file from “wordfile (1) .docx” to “my word file (01) docx” you have to use the following command:

ren "wordfile (1).docx" "my word file (01).docx"


650x195xwrn_6-650x195


4. Since the ren command can handle extensions, you can also use it to change the extensions of multiple files at once. For example, you have a choice of a .txt file that you want to convert into an html file. You can use the following command along with “*” :

ren *.txt *.html


5. You can also do some interesting things with “?”, which is used for every single character. For example, you have a lot of .html files that you want to convert into htm files. You can use the following command to make changes:

ren *.html *.???


This tells Windows to rename all files with the .html extension by using the same filename of the first three letters of the file's initial extension, meaning it truncates the letter “l” from all extensions in the folder.


Rename Multiple Files with PowerShell


PowerShell offers more flexibility to rename files in the command line. The two important commands you'll need are Dir, which lists files in the current directory, and Rename-Item, which renames items (files).

1. The fastest way to open PowerShell from is to open the folder in File Explorer. From the “File” menu, point to “Open Windows PowerShell,” and then select “Open Windows PowerShell.”


541x318xwrn_7


2. To rename a single file, you can use the following command syntax:

rename-item "current_filename.ext" "new_filename.ext"


3. So, for example, to rename a file from “wordfile (1) .docx” to “my word file (01) docx” you have to use the following command:

rename-item "wordfile.docx" "My Word File.docx"


650x103xwrn_8-650x103


4. Pretty easy. But the real power in PowerShell comes from the ability to commandlets and multiple switches supported by the rename-item commandlet. For example, you have many files named “wordfile (1) .docx”, “wordfile (2) .docx”, and so on.



index3


5. Say you want to replace the space between file names with underscores so that the file names do not contain spaces. You can use the following commandlet:

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


648x113xwrn_10


The Dir section of the commandlet lists all files in the folder and replaces them to run the rename-item commandlet.


And now, your files should look like this:


index2


However, PowerShell actually offers many other great uses for renaming multiple files.



Related Posts