Guides/Files
How to batch rename files in Windows 11
In File Explorer, select the files, press F2, type a name and press Enter: every file gets that name plus a number in brackets. To change part of each name instead, use PowerShell: Get-ChildItem -File *.jpg | Rename-Item -NewName { $_.Name -replace 'IMG_', 'Trip_' }. Add -WhatIf to the end to see the result without renaming anything. Command Prompt's ren *.txt *.md changes extensions in one go.
Windows 11 has three built-in ways to rename many files at once, and Microsoft offers a fourth as a separate download. Which one fits depends on what you want the new names to look like.
| You want | Use |
|---|---|
| The same name with a number on every file | File Explorer |
| A new extension on every file | Command Prompt, ren |
| To change, add or remove part of each name | PowerShell, Rename-Item |
| Search and replace with a preview window | PowerRename (PowerToys) |
F2 in File Explorer, ren and Rename-Item are the same in Windows 10, and PowerToys runs on Windows 10 version 2004 or newer.
File Explorer: one name, numbered
- Open the folder and select the files. Ctrl+A selects everything. Hold Ctrl and click to pick single files, or hold Shift and click to pick a range.
- Press F2.
- Type the new name and press Enter.
Every selected file gets the name you typed, followed by a number in brackets: Trip (1).jpg, Trip (2).jpg and so on. The extensions stay as they were.
That is all this method does. You cannot keep part of the old name, choose where the number goes or remove the brackets. If you rename the wrong files, press Ctrl+Z in the same File Explorer window to undo the rename.
Command Prompt: change extensions with ren
The ren command accepts wildcards. Open the folder in File Explorer, type cmd in the address bar and press Enter to get a Command Prompt in that folder. Then:
ren *.txt *.md
Every .txt file in the folder now ends in .md. Only the name changes. The content of the file is not converted.
Three things to know about ren:
- It works in one folder at a time and cannot move files to another folder or drive.
- If a new name is already taken, it stops for that file with
Duplicate file name or file not found. - There is no preview and no undo.
Wildcards in the new name copy the characters from the same position in the old name, which gets confusing fast for anything other than extensions. For other changes, PowerShell is easier to reason about.
PowerShell: change part of each name
Open the folder in File Explorer, right-click an empty area and choose Open in Terminal. The commands below were checked in Windows PowerShell 5.1 on Windows 11 and in PowerShell 7.
Always run the command with -WhatIf first. It prints what would be renamed and changes nothing:
Get-ChildItem -File *.jpg | Rename-Item -NewName { $_.Name -replace 'IMG_', 'Trip_' } -WhatIf
If the list looks right, run it again without -WhatIf:
Get-ChildItem -File *.jpg | Rename-Item -NewName { $_.Name -replace 'IMG_', 'Trip_' }
Get-ChildItem -File *.jpg lists the JPEG files in the current folder. For each one, the part in braces works out the new name: here it replaces IMG_ with Trip_. The -replace operator uses regular expressions and ignores letter case.
A few more patterns:
# Add text in front of every name
(Get-ChildItem -File *.pdf) | Rename-Item -NewName { '2026 ' + $_.Name }
# Add text before the extension
Get-ChildItem -File *.pdf | Rename-Item -NewName { $_.BaseName + ' signed' + $_.Extension }
# Replace spaces with underscores
Get-ChildItem -File | Rename-Item -NewName { $_.Name -replace ' ', '_' }
# Include files in subfolders
Get-ChildItem -File -Recurse *.jpg | Rename-Item -NewName { $_.Name -replace 'IMG_', 'Trip_' }
Rename-Item never replaces an existing file. If a new name is already taken, that one file gets an error and the rest are still renamed. It also cannot move files: the new name must be a name, not a path. And it has no undo, which is why -WhatIf is worth the extra run.
To number files in a set order, see how to rename files with sequential numbers.
PowerRename: search and replace with a preview
PowerRename is part of Microsoft PowerToys, a set of utilities you install separately. With it enabled, select files in File Explorer, right-click and choose Rename with PowerRename. You get a window with a Search for field, a Replace with field and a preview of the old and new names.
According to Microsoft’s documentation it supports regular expressions, case options, counters such as ${padding=4}, the file’s creation date and photo metadata. It also notes that File Explorer’s Ctrl+Z can undo the last change.
With VibeRename
VibeRename is a free, open-source app for the same job, built around steps instead of one search field.
- You stack steps (Replace, Insert, Remove, Case, Number, Date, Clean up, Extension, Template) and each one adds to the result of the one before.
- The preview shows every new name as you type. Names that clash or that Windows refuses are marked, and the Rename button stays off until they are fixed.
- Undo does not depend on File Explorer. The last 20 renames are kept in a history, and each can be undone later.
- A rename interrupted by a crash is finished or rolled back at the next start.
It is a preview release, it does not need administrator rights and it sends nothing over the network during a rename.
Questions people ask
How do I rename multiple files at once in File Explorer?
Select the files, press F2, type the new name and press Enter. All selected files get the same name, each with a number in brackets after it, such as Trip (1).jpg and Trip (2).jpg.
How do I rename part of a filename in multiple files in Windows 11?
Use PowerShell's -replace operator inside Rename-Item. For example: Get-ChildItem -File | Rename-Item -NewName { $_.Name -replace 'draft', 'final' } swaps the word draft for final in every file name in the current folder.
How do I bulk rename file extensions in Windows 11?
Open Command Prompt in the folder and type ren *.txt *.md. Every .txt file in that folder becomes a .md file. The content of the files is not converted, only the name changes.
Can I undo a batch rename in Windows?
In File Explorer, press Ctrl+Z right after the rename to undo it. Renames made with ren or PowerShell have no undo, so preview them first with -WhatIf or work on a copy.
Do I need extra software to bulk rename files in Windows 11?
No. File Explorer, Command Prompt and PowerShell are all part of Windows 11. Extra tools mainly add a preview, more kinds of changes and an undo.
Sources
- Microsoft Support: Keyboard shortcuts in Windows
- Microsoft Learn: Rename-Item
- Microsoft Learn: ren
- Microsoft Learn: PowerToys PowerRename utility
- Microsoft Learn: Install PowerToys
VibeWare is not affiliated with Microsoft or PowerToys. What this page says about them comes from their own pages, linked above.
Published · by Ted K. Johansen, who also makes VibeRename
Batch renaming with a live preview, conflicts caught first, every rename undoable. Free and open source, for Windows. No account, no ads, no telemetry.
VibeRename is made by Ted K. Johansen, who wrote this guide.