Having to rename multiple files manually can be a tedious process on Windows 10, but you can use these steps to speed things along.
On Windows 10, the process to rename a single file is easy, but it can become troublesome quickly when trying to change the name (or extension) to a long list of files within a folder.
Although, you can always install third-party tools to ease the process, Windows 10 includes various tools to make it easier to change the name of files using File Explorer, Command Prompt, and PowerShell.
In this Windows 10 guide, we'll walk you through three ways to rename multiple files, including changing the extension, without the need to resource to third-party tools.
- How to rename multiple files using File Explorer
- How to rename multiple files using Command Prompt
- How to rename multiple files using PowerShell
How to rename multiple files using File Explorer
On Windows 10, File Explorer offers the easiest methods to rename one or multiple files.
Rename multiple files one at a time
To rename multiple files with different names using the "Tab" key, use these steps:
- Open File Explorer.
- Browse to the folder with the files to rename.
- Click the View tab.
-
Select the Details view.
- Select the first file in the folder.
- Click the Home tab.
-
Click the Rename button.
Quick tip: You can also press the F2 button, right-click the files and select the Rename option, or click the file once and slowly click the file name again to trigger the rename action.
- Confirm the new name for the file.
- Press the Tab key to jump and trigger the rename action for the next file.
- Confirm the new file name.
- Press the Tab key again to jump and trigger the next rename.
Once you complete these steps, you may need to repeat step No. 10 until you're done renaming files.
Rename multiple files at once
To rename multiple files in bulk with the same name structure, use these steps:
- Open File Explorer.
- Browse to the folder with the files to rename.
- Click the View tab.
-
Select the Details view.
- Click the Home tab.
-
Click the Select all button.
Quick tip: You can also use the Ctrl + A keyboard shortcut to select all files quickly. You can press and hold the Ctrl key and then click the files to rename, or you can even choose the first file, press and hold the Shift key, and then click the last file to select a group.
- Click the Rename button.
-
Type the new file name and press Enter.
After you complete these steps, all the selected files will be renamed using the same name structure with a count number between parentheses to make each name different. For example, summer_trip_2020 (1).jpg and summer_trip_2020 (2).jpg.
If you made a mistake, you could use the Ctrl + Z keyboard shortcut to undo the changes. Alternatively, you can click the menu button from the top-left corner (on the title bar of File Explorer) and select the Undo button.
How to rename multiple files using Command Prompt
You can also use Command Prompt to change the name of one or multiple files in bulk.
Rename single file
To rename one file with Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt and click the top result to open the app.
-
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 "files" folder inside "Documents":
cd %USERPROFILE%\Documents\files
-
Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to rename a file and press Enter:
ren "OLD-FILE-NAME.EXTENSION" "NEW-FILENAME.EXTENSION"
In the command, the quotation marks are only required if the name includes spaces.
This example renames the file to "summer_trip_20_notes.txt":
ren s_trip_2020_notes.txt summer_trip_20_notes.txt
Once you complete these steps, you may need to repeat step No. 5 to change the name of the remaining files.
Rename multiple files
To rename multiple files in bulk with the same name structure with Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt and click the top result to open the app.
-
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 "files" folder inside "Documents":
cd %USERPROFILE%\Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to rename multiple files in bulk and press Enter:
ren *.FILE-EXTENSION ???-FILE-NAME.*
In the command, the asterisk
*
is a wildcard that tells the ren command to rename everything with a ".jpg" extension. The question mark?
is also a wildcard, but it represents a character of the original file name.This example renames all ".jpg" files leaving the first three characters (which works as a unique identifier to avoid duplication) and appends "-hikingTrails" to the name:
ren *.jpg ???-hikingTrip.*
After you complete these steps, all files from a specific format will be renamed using the settings you specified.
Trim multiple file names
To make long file names shorter with Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt and click the top result to open the app.
-
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 "files" folder inside "Documents":
cd %USERPROFILE%\Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to make file names shorter and press Enter:
ren *.* CHARACTER-COUNT.*
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.This example trims the file names longer than five characters:
ren *.* ?????.*
If the file name is less than five characters, then the name will not change. (If you want to make the file name longer, add extra question marks.)
Once you complete these steps, you'll end up with shorter file names depending on the question marks (?) you specified in the command.
Modify multiple file names
To rename part of the file name on similar files, use these steps:
- Open Start.
- Search for Command Prompt and click the top result to open the app.
-
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 "files" folder inside "Documents":
cd %USERPROFILE%\Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to rename part of file name and press Enter:
ren OLD-FILE-NAME-PART*.* NEW-FILENAME-PART*.*
This example renames names files start with "summer_trip_20" to "vacation_2020":
ren summer_trip_20*.* vacation_2020*.*
After you complete these steps, the group of files with similar names will be modified with the new name structure.
Change file extension
To change the file extension to another compatible extension, use these steps:
- Open Start.
- Search for Command Prompt and click the top result to open the app.
-
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 "files" folder inside "Documents":
cd %USERPROFILE%\Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to change the file extension and press Enter:
ren *.OLD-EXTENSION *.NEW-EXTENSION
This example changes the extension from ".txt" to ".doc" compatible with Microsoft Word for the files in the folder:
ren *.txt *.doc
This example changes only extension of a single file from ".txt" to ".doc":
ren vacation_2020_notes.txt vacation_2020_notes.doc
Once you complete these steps, the file extension will change to the new extension you specified in the command.
Rename specific extension file names
The previous instructions are meant to rename every file within the folder location. However, if you want to rename only a group of files with a particular format, you need to omit the asterisk *
and specify the target extension in the command.
To rename files with a specific file extension, use these steps:
- Open Start.
- Search for Command Prompt and click the top result to open the app.
-
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 "files" folder inside "Documents":
cd %USERPROFILE%\Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to change the extension for a group of files and press Enter:
ren FILE-NAME*.EXTENSION FILE-NAME*.EXTENSION
This example only renames images with a ".jpg" extension:
ren vacation_2020_*.jpg summer_trip_2020_*.jpg
After you complete the steps, Command Prompt will rename the files using the settings that you specified in the command.
How to rename multiple files using PowerShell
On Windows 10, PowerShell is a scripting tool, similar to Command Prompt, which allows you to rename files virtually any way you want. Although there are many ways to use PowerShell to manipulate files, these instructions walk you through the most common scenarios to rename one as well as various files at the same time.
Rename single file
To rename only one file using PowerShell, use these steps:
- Open Start.
- Search for PowerShell and click the top result to open the app.
-
Type the following command example to navigate to the folder with the files you want to rename and press Enter:
cd Documents\files
Quick note: The above command opens the "files" folder inside "Documents," but you can use
cd c:\users\USER-FOLDER-NAME\PATH\TO\FOLDER
example syntax to navigate to other folder locations. -
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
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, the quotation marks are only required if the name includes spaces.
This example renames the file to "summer_trip_2020_notes.txt":
Rename-Item hiking_trip_notes.txt summer_trip_2020_notes.txt
Once you complete the steps, you may need to repeat step No. 5 to continue renaming other files.
Rename multiple files in bulk
To rename multiple files in bulk, when the name structure isn't important, use these steps:
- Open Start.
- Search for PowerShell and click the top result to open the app.
-
Type the following command example to navigate to the folder with the files you want to rename and press Enter:
cd Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to rename multiple files in bulk and press Enter:
Dir | %{Rename-Item $_ -NewName ("NEW-FILE-NAME{0}.EXTENSION" -f $nr++)}
This example renames images with a ".jpg" extension using the same ("beach_trip_2020") naming structure and appends a different number at the end of the name:
Dir | %{Rename-Item $_ -NewName ("beach_trip_2020{0}.jpg" -f $nr++)}
After you complete these steps, all the files with the format you specified will rename using your configuration.
Trim multiple file names
To make file names shorter, or trim part of the names by an N number of characters, use these steps:
- Open Start.
- Search for PowerShell and click the top result to open the app.
-
Type the following command example to navigate to the folder with the files you want to rename and press Enter:
cd Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to rename files using shorter names and press Enter:
Dir | Rename-Item -NewName {$_.name.substring(0,$_.BaseName.length-N) + $_.Extension}
In the command update, "$_.BaseName.length-N" by changing the value of "N" to specify the number of characters that you want to remove.
This example will trim the name of your files by eight characters:
Dir | Rename-Item -NewName {$_.name.substring(0,$_.BaseName.length-8) + $_.Extension}
Once you complete these steps, you'll end up with shorter file names depending on the length you specified in the command.
Delete part of the name from multiple files
To remove part of the file name on multiple files with PowerShell, use these steps:
- Open Start.
- Search for PowerShell and click the top result to open the app.
-
Type the following command example to navigate to the folder with the files you want to rename and press Enter:
cd Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to remove part of the file name and press Enter:
Dir | Rename-Item -NewName {$_.name -replace "OLD-FILE-NAME-PART",""}
This example removes the word "trip" from the name of all files in the folder:
Dir | Rename-Item -NewName {$_.name -replace "trip",""}
After you complete these steps, the command will delete the part of the filenames that you specified in the command.
Replace part of the name from multiple files
To rename the same part of the file name, use these steps:
- Open Start.
- Search for PowerShell and click the top result to open the app.
-
Type the following command example to navigate to the folder with the files you want to rename and press Enter:
cd Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to replace part of file name and press Enter:
Dir | Rename-Item -NewName {$_.name -replace "OLD-FILE-NAME-PART,"NEW-FILE-NAME-PART"}
This example replaces the word "vacation_" for "hiking_trip_" on the file name:
Dir | Rename-Item -NewName {$_.name -replace "vacation_","hiking_trip_"}
Once you complete these steps, the command will modify the part of the filenames with the replacement you specified in the command.
Remove spaces from multiple files
Spaces within the file names can sometimes cause issues, especially when using a command line. If you have filenames with spaces, you can modify the name to include a visual separator, such as a dash or underscore symbol.
To remove and replace spaces with underscores, use these steps:
- Open Start.
- Search for PowerShell and click the top result to open the app.
-
Type the following command example to navigate to the folder with the files you want to rename and press Enter:
cd Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to remove spaces from file name and press Enter:
Dir | Rename-Item -NewName { $_.Name -replace "SPACE","SEPARATOR" }
This example replaces spaces with underscores in all files:
Dir | Rename-Item -NewName { $_.Name -replace " ","_" }
After you complete these steps, the spaces within the filenames will be replaced with the separator you specified.
Change file extension
To change the file extension for a bunch of files with PowerShell, use these steps:
- Open Start.
- Search for PowerShell and click the top result to open the app.
-
Type the following command example to navigate to the folder with the files you want to rename and press Enter:
cd Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to change the extension on files and press Enter:
Dir | Rename-Item -NewName { [io.path]::ChangeExtension($_.name, "NEW-EXTENSION") }
This example changes any file extension to ".doc":
Dir | Rename-Item -NewName { [io.path]::ChangeExtension($_.name, "doc") }
Once you complete the steps, PowerShell will change the extension to the one you specified in the command.
Rename specific extension file names
The previous instructions are meant to rename every file within the folder location. However, if you want to rename a particular file format, such as documents, pictures, or videos, then you can use the "-filter" option.
To change the names of a specific file format, use these steps:
- Open Start.
- Search for PowerShell and click the top result to open the app.
-
Type the following command example to navigate to the folder with the files you want to rename and press Enter:
cd Documents\files
-
(Optional) Type the following command to view a listing of the files and press Enter:
dir
-
Type the following command to rename files with a specific extension and press Enter:
Dir -filter *.EXTENSION | %{Rename-Item $_ -NewName ("NEW-FILE-NAME{0}.EXTENSION" -f $nr++)}
This example renames only files that include the ".jpg" extension:
Dir -filter *.jpg | %{Rename-Item $_ -NewName ("beach_trip_{0}.jpg" -f $nr++)}
Once you complete the steps, PowerShell will rename the files of a specific extension using the name that you specified in the command.
Although these commands have been tested to work as expected, it's always recommended that you perform a test run before trying to rename the original files.
More Windows 10 resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:
Source: https://ift.tt/2GzCA2z