Categories
Design

How to batch rename multiple files in windows

Do it in File Explorer or use Windows PowerShell

How to batch rename multiple files in windows

  • Facebook
  • Twitter
  • LinkedIn
  • Tweet
  • Share
  • Email

Renaming a file on Windows 10 is simple. You just right-click and select Rename. But doing this for a few dozen or a few hundred files gets tedious. Thankfully, it’s easy to batch rename files in Windows 10 using File Explorer, PowerShell, or the Command Prompt.

Batch Rename Files in Windows 10 Using File Explorer

If you have a batch of pictures or other files that share something in common, you can rename all the files to use the same basic file structure.

For example, you can rename all your Disney World vacation photos from 2019 to ‘Disneyworld Vacation Photos 2019.’ When you batch rename files in Windows 10 using File Explorer (also known as File Manager), each file receives the new name with a number at the end, such as (1), (2), and so on.

Open File Explorer and navigate to the folder that contains all the files you want to rename.

How to batch rename multiple files in windows

Select View > Details in the Layout group in the ribbon. This lets you view the entire file name for each file in the folder.

How to batch rename multiple files in windows

Select all files in the folder by selecting the first file, holding the Shift key, and then selecting the last file. Or you can select Ctrl+A to select all files as well.

How to batch rename multiple files in windows

Select Home > Rename from the Organize group in the ribbon. This will change the first file to a field so you can type the new file name. Type the file name you’d like to use to rename all the files.

How to batch rename multiple files in windows

When you press Enter, you’ll notice all the other selected files received the same name with a number at the end to differentiate each file.

How to batch rename multiple files in windows

Using File Explorer to batch rename files in Windows 10 is just as fast as renaming a single file, with just a few extra clicks.

If you mistyped the name or changed your mind about renaming all the files, you can press Ctrl+Z to undo your last rename operation.

Batch Rename Multiple Files With PowerShell

If you prefer using a command line tool to rename all your files, PowerShell is an excellent tool.

Using the last example, you can use PowerShell to rename all the files so that the first word of the file name is “Our” instead of “My”.

Select the Start menu, type Powershell, and select Windows PowerShell to open the app.

How to batch rename multiple files in windows

Navigate to the directory where your files are stored by using the cd command to navigate folders.

How to batch rename multiple files in windows

Once you’re in the correct directory, type the command:

Then press Enter.

How to batch rename multiple files in windows

How the parameters for this function work:

  • Dir: Sends all files in the folder to the rename-item command
  • rename-item: A PowerShell command to rename files
  • $_.name: Symbolizes each of the file being replaced
  • -replace: Tells PowerShell that the action to take on each file is to replace the name
  • “My”,”Our”: The first word in quotes is the word in each title to replace, and the second word is what you want to replace it with

The Dir command in PowerShell has a lot of functionality.

The rename-item command in PowerShell has other syntax you can use. For example following rename-item with “$_ “Preface – $_” will add “Preface – “ to the front of every filename.

When the command finishes, you’ll notice all your files have been renamed in the manner you specified.

How to batch rename multiple files in windows

Batch Rename Multiple Files With Command Prompt

You can also rename multiple files using the command prompt and the ? (question mark) wildcard.

Launch the command prompt and navigate to the folder where your files are stored.

How to batch rename multiple files in windows

Type the command

Then press Enter.

How to batch rename multiple files in windows

Now you’ll see all the files have been renamed, keeping the first 12 original characters of the file name and adding “-Vacation” at the end.

How to batch rename multiple files in windows

Using the command prompt is an easy way to rename files quickly, keeping a unique portion of the file name while adding something descriptive at the end.

Whether you choose to batch rename files in Windows 10 using File Explorer, PowerShell, or Command Prompt really depends on the original file names and how you want to rename them.

Not using Windows Explorer, no.

However it’s a snap using the Windows Command Prompt.

In Windows Explorer, when you drag and drop a file from one location to another, you must let the copy (or move) operation complete before you can then rename the file in its new location.

However, using the COPY command in the Windows Command Prompt, you can do it in one quick step.

Start by firing up a command prompt – usually Start, All Programs, Accessories, Command Prompt. You’ll probably get something like this:

How to batch rename multiple files in windows

The COPY command has the following syntax:

The “trick” here, if you want to call it that, is that the destination can either be the folder to receive the file, or it can include the new filename.

How to batch rename multiple files in windows

Executed with “C:\Documents and Settings\LeoN” as the current directory, copied “C:\Documents and Settings\LeoN\current.txt” to “C:\Documents and Settings\LeoN\My Documents\current.txt”.

Now, this time we’ll specify a filename:

How to batch rename multiple files in windows

This time we copied “C:\Documents and Settings\LeoN\current.txt” to “C:\Documents and Settings\LeoN\My Documents\copy.txt“. In other words we copied the file, and gave the copy a new name in one operation.

These examples all assumed that the file you want to copy is in the “current directory” (or current folder), as listed in the command prompt itself. You can change directories with the “CD” command:

How to batch rename multiple files in windows

Now your COPY operations will be relative to the new current directory.

Alternatively the COPY command will work with full paths as well, eliminating any reliance on the current directory:

How to batch rename multiple files in windows

This example performed the same copy-and-rename we did earlier, but doesn’t rely on any assumptions about the current directory. It specifies a full path to both the source and destination.

As you can imagine, the Command Prompt, while somewhat arcane for the average user, is incredibly powerful. Depending on your plans, it could be well worth spending a little time learning more about.

Subscribe to Confident Computing! Tech problem solving & safety tips & a weekly confidence boost in your inbox every week.

I’ll see you there!

How to batch rename multiple files in windows

Slow Computer?

Speed up with my special report: 10 Reasons Your Computer is Slow, now updated for Windows 10.

NOW: name your own price! You decide how much to pay — and yes, that means you can get this report completely free if you so choose. Get your copy now!