How to batch rename files in Windows

Number a folder of holiday photos, put the date in front of every scan, or replace spaces with dashes. Here are three ways to rename many files at once on Windows 10 and 11, from quickest to most flexible.

Updated 19 October 2026 · By the FilesPro team

On this page
  1. File Explorer: same name plus a number
  2. PowerShell: any rule you can script
  3. FilesPro: patterns with a live preview and undo
  4. Tips that save you from a mess

1. File Explorer: same name plus a number

Windows can rename a group of files to one name with a number in brackets. No extra software needed.

  1. Open the folder in File Explorer and select the files (CtrlA selects all).
  2. Press F2.
  3. Type the new name, for example Iceland, and press Enter.

The files become Iceland (1).jpg, Iceland (2).jpg, Iceland (3).jpg and so on. Extensions are kept.

Limits: that's the only pattern. You can't choose the number format, add dates, keep part of the old name, or replace text. For anything more, use one of the methods below.

2. PowerShell: any rule you can script

PowerShell comes with Windows and can rename files with any rule. Open the folder in File Explorer, type powershell in the address bar and press Enter, then use one of these.

Number files with leading zeros

$i = 1
Get-ChildItem *.jpg | Sort-Object Name | ForEach-Object {
    Rename-Item $_ -NewName ('Iceland-{0:D2}{1}' -f $i, $_.Extension)
    $i++
}

Result: Iceland-01.jpg, Iceland-02.jpg… Change D2 to D3 for three digits.

Replace spaces with dashes

Get-ChildItem -File | Where-Object Name -like '* *' |
    Rename-Item -NewName { $_.Name -replace ' ', '-' }

Put the date modified in front

Get-ChildItem -File | Rename-Item -NewName {
    $_.LastWriteTime.ToString('yyyy-MM-dd') + ' ' + $_.Name
}

Add -WhatIf to the end of Rename-Item to see what would happen without renaming anything. PowerShell has no undo, so try it on a copy of the folder first.

Limits: you need to get the script right, there's no preview unless you use -WhatIf, and reading photo EXIF dates or music tags takes a lot more code.

3. FilesPro: patterns with a live preview and undo

FilesPro is a file manager for Windows with a built-in batch rename. You type a pattern, see every new name before anything changes, and can undo the whole batch in one step, even after a restart.

  1. Select the files in FilesPro.
  2. Press CtrlM (or open the command palette with CtrlShiftP and type batch rename).
  3. Type a pattern, for example Iceland-{n:2}{ext}. Set Start and Step for the counter if you need them.
  4. Optionally add Find and Replace with (tick Regular expression for patterns), and a Case change: lowercase, UPPERCASE or Title Case. The case change leaves the extension alone.
  5. Check the preview. Names that Windows doesn't allow, names that end with a period or space, reserved names like CON, and names that clash with each other or with other files are flagged before you rename.
  6. Press Rename. Changed your mind? CtrlZ undoes the whole batch.

Pattern tokens

TokenBecomesExample
{name}Original name, without the extensionBlack sand beach
{ext}Original extension, with the dot.jpg
{n}Counter (set Start and Step)1, 2, 3
{n:3}Counter padded with zeros001, 002, 003
{date}Date modified (yyyy-MM-dd)2026-09-14
{date:yyyyMMdd}Date modified, any .NET date format20260914
{taken}Photo's EXIF date taken (also takes a format)2026-09-14
{camera}Camera model from EXIFX-T5
{width} {height}Image size in pixels1600 1000
{artist} {album} {title}Music tags (ID3)Aurora
{track} {track:2}Track number, optionally padded7, 07
{year} {genre}More music tags2026
{parent}Name of the folder the file is inIceland trip

Examples

PatternBeforeAfter
Iceland-{n:2}{ext}Black sand beach.jpgIceland-01.jpg
{taken} {name}{ext}IMG_4021.jpg2026-09-14 IMG_4021.jpg
{parent} {n:3}{ext}IMG_4021.jpg (in Iceland trip)Iceland trip 001.jpg
{track:2} - {artist} - {title}{ext}audio_07.mp307 - Aurora - Runaway.mp3
{date:yyyyMMdd}_{name}{ext}Report.pdf20261018_Report.pdf

Find and replace runs after the pattern. For example, find \s+ and replace with - with Regular expression ticked turns every run of spaces into a single dash.

Tips that save you from a mess

Frequently asked questions

Can I batch rename files in Windows without software?

Yes. Select the files in File Explorer and press F2 to give them one name with a number, or use PowerShell's Rename-Item for any other rule.

How do I rename files with numbers in order?

Sort the files the way you want, then use a counter: {n:2} in FilesPro gives 01, 02, 03; in PowerShell use '{0:D2}' -f $i and increase $i for each file.

Can I rename photos by the date they were taken?

Yes, with a tool that reads EXIF data. In FilesPro use {taken}, for example {taken:yyyy-MM-dd} {name}{ext}.

Can I undo a batch rename?

PowerShell can't undo. FilesPro undoes a whole batch with Ctrl+Z, many steps deep, and keeps that history across restarts.

Rename hundreds of files in secondsA fast, keyboard-first file manager for Windows 10 and 11. No account, no ads, no telemetry.
Get it from the Microsoft Store

Related