How To Batch Rename Multiple Files On Windows 10
How To Batch Rename Multiple Files On Windows 10
How-to
By Mauro Huculak
last updated December 7, 2023
You can use various tools to rename multiple files on Windows 10, and here's
how.
Jump to:
File Explorer
Command Prompt
PowerShell
PowerToys
On Windows 10, changing the name of one file is easy. The problem is when you must rename
many files in a specific folder, but don't worry. In this guide, I'll outline the steps to complete this
task.
If you have to rename a long list of files, it's possible to speed up the process using File Explorer,
PowerShell, Command Prompt, and even the Microsoft PowerToys app.
In this guide, I'll walk you through several ways to bulk rename files, including changing the
extension.
Sponsored Links
PLAY SOUND
Contact me with news and offers from other Future brandsReceive email from us on behalf of
our trusted partners or sponsors
By submitting your information you agree to the Terms & Conditions and Privacy Policy and are aged
16 or over.
1. Open File Explorer.
2. Navigate to the folder with the files to change their names.
3. Click the View tab.
4. Select the Details view.
(Image credit: Mauro Huculak)
5. Click the Home tab.
6. Click the Select all button.
Quick tip: Alternatively, you can select all files using the "Ctrl + A" keyboard shortcut.
You can press and hold the "Ctrl" key and then click each file to rename. Or you can
choose the first file, press and hold the "Shift" key, and then click the last file to select a
group.
1. Open Start.
2. Search for Command Prompt and click the top result to open the app.
3. Type the following command example to navigate to the folder with the files to rename,
and press Enter: cd c:\PATH\TO\FILES
For instance, this example opens the "rename" folder inside "Pictures": cd %USERPROFILE%\
Pictures\rename
4. Type the following command to view the files in the location and press Enter: dir
5. Type the following command to rename the file and press Enter: ren "OLD-
FILENAME.EXTENSION" "NEW-FILENAME.EXTENSION"
In the command, replace "OLD-FILENAME.EXTENSION" and "NEW-
FILENAME.EXTENSION" with the old and new file names. The quotation marks are only
necessary if the title includes spaces. For instance, this command renames the file to
"summer_trip_23_notes.txt": ren summer_trip_23_notes.txt summer_vacation_23_notes.txt
(Image credit: Mauro Huculak)
6. Repeat step 5 to change the name of the remaining files.
Once you complete these steps, Command Prompt will rename the file with the new name.
1. Open Start.
2. Search for Command Prompt and click the top result to open the app.
3. Type the following command example to navigate to the folder with the files to rename,
and press Enter: cd c:\PATH\TO\FILES
For example, this example opens the "rename" folder inside "Pictures": cd %USERPROFILE%\
Pictures\rename
4. (Optional) Type the following command to view the files in the location and
press Enter: dir
5. Type the following command to rename the files in bulk and press Enter: ren *.FILE-
EXTENSION ???-FILE-NAME.*
In the command, replace "FILE-EXTENSION" with the extension to change and "FILE-
NAME" with part of the name to add to the files. The asterisk (*) is a wildcard that tells the ren
command to rename everything with a specific extension. The question mark (?) is also a
wildcard, but it represents a character of the original name you want to keep as part of the new
name. For example, this command renames all ".jpg" files, leaving the first three characters
(which works as a unique identifier to avoid duplication), and appends "-Camping-Trip" to the
name: ren *.jpg ???-Camping-Trip.*
Quick tip: When renaming files, the "ren" command sees a period (.) as the end of the
filename. The command may produce unexpected results if you have files with a period
as part of the name.
(Image credit: Mauro Huculak)
After you complete the steps, the files will be renamed using the settings you specified.
1. Open Start.
2. Search for Command Prompt and click the top result to open the app.
3. Type the following command example to navigate to the folder with the files to rename,
and press Enter: cd c:\PATH\TO\FILES
This example opens the "rename" folder inside "Pictures": cd %USERPROFILE%\Pictures\
rename
4. (Optional) Type the following command to view the files in the location and
press Enter: dir
5. Type the following command to make file names shorter and press Enter: ren
*.* ?????.*
In the command, the asterisk (*) matches all the file names and extensions in the folder, and the
question marks (?) indicate how many characters to use for the new file name. For instance, this
command trims the file names longer than five characters: ren *.* ?????.*
Quick note: If the file name has fewer than five characters, the name will not change. (If
you want to shorten the file name, add extra question marks in the syntax.)
(Image credit: Mauro Huculak)
Once you complete these steps, the command will run and shorten the file name, depending on
the question marks (?) available in the command.
Modify multiple file names
To rename part of the name on similar files on Windows 10, use these steps:
1. Open Start.
2. Search for Command Prompt and click the top result to open the app.
3. Type the following command example to navigate to the folder with the files to rename,
and press Enter: cd c:\PATH\TO\FILES
This example opens the "rename" folder inside "Pictures": cd %USERPROFILE%\Pictures\
rename
4. (Optional) Type the following command to view the files in the location and
press Enter: dir
5. Type the following command to rename the part of the file name and press Enter: ren
OLD-FILE-NAME-PART*.* NEW-FILENAME-PART*.*
In the command, replace "OLD-FILE-NAME-PART" and "NEW-FILENAME-PART" with
the old and new parts of the filename. The asterisk (*) is a wildcard that will match the rest of the
filename and file extension to append the new part of the name. For instance, this command
renames files that start with "summer_trip_23" to "vacation_2023": ren summer_trip_23*.*
vacation_2023*.*
(Image credit: Mauro Huculak)
After you complete the steps, the command will modify those files like the new name structure
available in the command.
1. Open Start.
2. Search for Command Prompt and click the top result to open the app.
3. Type the following command example to navigate to the folder with the files you want to
rename and press Enter: cd c:\PATH\TO\FILES
This example opens the "rename" folder inside "Pictures": cd %USERPROFILE%\Pictures\
rename
(Optional) Type the following command to view a listing of the files in the location and
press Enter: dir
5. Type the following command to change the file extension and press Enter: ren *.OLD-
EXTENSION *.NEW-EXTENSION
In the command, change "OLD-EXTENSION" and "NEW-EXTENSION" with the old and
new file extensions. For example, this command changes the extension from ".txt" to ".doc"
compatible with Microsoft Word for the files in the location: ren *.txt *.doc
This example without wildcards (*) changes the only extension of a single file from ".txt" to
".doc": ren vacation_2023_notes.txt vacation_2023_notes.doc
1. Open Start.
2. Search for Command Prompt and click the top result to open the app.
3. Type the following command example to navigate to the folder with the files to rename,
and press Enter: cd c:\PATH\TO\FILES
This example opens the "rename" folder inside "Pictures": cd %USERPROFILE%\Pictures\
rename
4. (Optional) Type the following command to view the files in the location and
press Enter: dir
5. Type the following command to change the file extension in the location and
press Enter: ren OLD-FILE-NAME*.EXTENSION NEW-FILE-
NAME*.EXTENSION
In the command, change "OLD-FILE-NAME," "NEW-FILE-
NAME," and "EXTENSION" with the old and new file name and extension. For instance, this
command only renames images with a ".jpg" extension: ren picture-*.jpg vacation*.jpg
1. Open Start.
2. Search for PowerShell and click the top result to open the app.
3. Type the following command example to navigate the folder with the files to rename and
press Enter: cd PATH\TO\FOLDER
In the command, replace "PATH\TO\FOLDER" with the actual path to the location. For
example, this command navigates the "rename" folder inside "Pictures": cd C:\Users\
USERNAME\Pictures\rename
4. (Optional) Type the following command to view the files in the location and
press Enter: ls
5. Type the following command to change the name of a single file and
press Enter: Rename-Item "OLD-FILE-NAME.EXTENSION" "NEW-FILE-
NAME.EXTENSION"
In the command, specify the old and new file names and extensions. The quotation marks are
only required if the name includes spaces. For instance, this command renames the file to
"hiking_trip_2023_notes.txt": Rename-Item summer_trip_23_notes.txt
hiking_trip_2023_notes.txt
1. Open Start.
2. Search for PowerShell and click the top result to open the app.
3. Type the following command example to navigate to the folder with the files to rename
and press Enter: cd PATH\TO\FOLDER
In the command, replace "PATH\TO\FOLDER" with the actual path to the location. For
example, this command navigates the "rename" folder inside "Pictures": cd C:\Users\
USERNAME\Pictures\rename
4. (Optional) Type the following command to view a listing of the files in the location and
press Enter: ls
5. Type the following command to rename multiple files in bulk and press Enter: ls | %
{Rename-Item $_ -NewName ("NEW-FILE-NAME-{0}.EXTENSION" -f $nr++)}
In the command, replace "NEW-FILE-NAME" with the structure name you want to use. For
example, this command renames images with a ".jpg" extension using the same ("beach-trip-
2023-") naming structure and appends a different number at the end of the name: ls | %
{Rename-Item $_ -NewName ("beach-trip-2023-{0}.jpg" -f $nr++)}
(Image credit: Mauro Huculak)
After you complete these steps, the files with the specified format will be renamed using the
structure available with the command.
1. Open Start.
2. Search for PowerShell and click the top result to open the app.
3. Type the following command example to navigate to the files to rename and
press Enter: cd PATH\TO\FOLDER
In the command, replace "PATH\TO\FOLDER" with the actual path to the location. For
example, this command navigates the "rename" folder inside "Pictures": cd C:\Users\
USERNAME\Pictures\rename
4. (Optional) Type the following command to view the files in the location and
press Enter: ls
5. Type the following command to remove part of the file name and press Enter: ls |
Rename-Item -NewName {$_.name -replace "OLD-FILE-NAME-PART",""}
In the command, replace "OLD-FILE-NAME-PART" with the actual part of the name you
want to replace. For instance, this command removes the word "trip" from the name of all files
in the folder: ls | Rename-Item -NewName {$_.name -replace "beach",""}
1. Open Start.
2. Search for PowerShell and click the top result to open the app.
3. Type the following command example to navigate to the folder with the files to rename
and press Enter: cd PATH\TO\FOLDER
In the command, replace "PATH\TO\FOLDER" with the actual path to the location. For
example, this command navigates the "rename" folder inside "Pictures": cd C:\Users\
USERNAME\Pictures\rename
4. (Optional) Type the following command to view a listing of the files in the location and
press Enter: ls
5. Type the following command to replace part of file name and press Enter: ls | Rename-
Item -NewName {$_.name -replace "OLD-FILE-NAME-PART","NEW-FILE-
NAME-PART"}
In the command, replace "OLD-FILE-NAME-PART" and "NEW-FILE-NAME-
PART" with the old and new parts of the file name. For example, this command replaces the
word "vacation_" for "camping_trip_" in the file name: ls | Rename-Item -NewName
{$_.name -replace "vacation_","camping_trip_"}
To remove and replace spaces with underscores in filenames with PowerShell, use these steps:
1. Open Start.
2. Search for PowerShell and click the top result to open the app.
3. Type the following command example to navigate to the folder with the files to rename
and press Enter: cd PATH\TO\FOLDER
In the command, replace "PATH\TO\FOLDER" with the actual path to the location. For
example, this command navigates the "rename" folder inside "Pictures": cd C:\Users\
USERNAME\Pictures\rename
1. (Optional) Type the following command to view the files in the location and
press Enter: ls
5. Type the following command to remove spaces from file name and press Enter: ls |
Rename-Item -NewName { $_.Name -replace " ","SEPARATOR" }
In the command, make sure to replace "SEPARATOR" with the symbol instead of a space. For
instance, this command replaces spaces with underscores in the files: ls | Rename-Item -
NewName { $_.Name -replace " ","_" }
1. Open Start.
2. Search for PowerShell and click the top result to open the app.
3. Type the following command example to navigate to the folder with the files to rename
and press Enter: cd PATH\TO\FOLDER
In the command, replace "PATH\TO\FOLDER" with the actual path to the location. For
example, this command navigates the "rename" folder inside "Pictures": cd C:\Users\
USERNAME\Pictures\rename
1. (Optional) Type the following command to view the files in the location and
press Enter: ls
5. Type the following command to change the extension on files and press Enter: ls |
Rename-Item -NewName { [io.path]::ChangeExtension($_.name, ".NEW-
EXTENSION") }
In the command, replace ".NEW-EXTENSION" with a new file extension. For instance, this
command changes any file extension to ".doc": ls | Rename-Item -NewName
{ [io.path]::ChangeExtension($_.name, "doc") }
1. Open Start.
2. Search for PowerShell and click the top result to open the app.
3. Type the following command example to navigate to the folder with the files to rename
and press Enter: cd PATH\TO\FOLDER
In the command, replace "PATH\TO\FOLDER" with the actual path to the location. For
example, this command navigates the "rename" folder inside "Pictures": cd C:\Users\
USERNAME\Pictures\rename
4. (Optional) Type the following command to view the files in the location and
press Enter: ls
5. Type the following command to rename files with a specific extension and
press Enter: ls -filter *.EXTENSION | %{Rename-Item $_ -NewName ("NEW-FILE-
NAME-{0}.EXTENSION" -f $nr++)}
In the command, replace "NEW-FILE-NAME" and "EXTENSION" with the new parameter.
For instance, this command renames only files that include the ".doc" extension: ls -filter *.doc
| %{Rename-Item $_ -NewName ("beach-trip-{0}.doc" -f $nr++)}
(Image credit: Mauro Huculak)
Once you complete the steps, PowerShell will rename the files with a specific extension
specified in the command.
While these commands have been tested to work as expected, it is always recommended that you
perform a test run before renaming the original files on your computer.
Install PowerToys
To install PowerToys on Windows 10, use these steps:
PowerToys PowerRename is a powerful tool that lets you manipulate file names virtually in any
way you want using regular expressions. You can learn more about the options available to
create patterns to rename files in this Microsoft documentation page.