Skip to main content

We’d like to load Google’s advertising tag to measure how our ads perform. It sets cookies and is optional. Privacy policy.

Mudry
Guides

How to batch rename files on Windows (four methods)

Batch rename files on Windows with File Explorer, PowerToys PowerRename, the command line or PowerShell — and which one to pick for the job you have.

Roman Modrytskyi4 min read

Written by the team building Quick File Organizer, folders that organize themselves, by your rules.


You have three hundred files called DSC_0001.JPG and you want them to say something useful. Windows has four different ways to batch rename files and they are not equally good.

Here they are in the order most people should try them.

1. File Explorer — the built-in one

Select the files, press F2, type a name, press Enter. Windows renames every selected file to name (1), name (2), and so on.

That is the entire feature. It is genuinely useful for a batch of holiday photos and useless for anything else.

There is also a padding problem: Explorer produces (1) through (10), which sorts as 1, 10, 2, 3. For anything you will later sort by name, that is a real defect — see the numbering trap below.

2. PowerToys PowerRename — what to actually use

Microsoft PowerToys is a free, official add-on. PowerRename is the part that matters here.

Install it, then right-click any selection of files and choose PowerRename. You get:

  • Find and replace across all selected names
  • Optional regular expressions, with a live preview
  • Case changes
  • Numbering with configurable padding
  • A preview column showing exactly what each file will be called

That preview is the whole reason to prefer it. You see every result before committing, and conflicts are flagged before they happen.

3. Command Prompt — one job, done fast

ren *.jpeg *.jpg

Changing every extension in a folder is the one thing ren does better than anything else — it is instant and requires nothing installed.

Beyond that it gets unpredictable quickly, because wildcard matching in ren behaves in ways that surprise people. Use it for extensions and stop there.

4. PowerShell — power, and rope

Get-ChildItem *.jpg | Rename-Item -NewName { $_.Name -replace 'DSC_', 'Holiday_' }

Complete control. Also no preview, no undo, and a genuine ability to destroy a folder if the expression is wrong.

The numbering trap

This catches everyone once.

file1, file2file10 sorts as 1, 10, 2, 3, 4 — because names sort character by character, and "1" comes before "2".

The fix is zero padding, decided by your largest number:

FilesPad toGives
Under 1002 digits01, 02, 99
Under 10003 digits001, 010, 999

Pad generously. Going from two digits to three later means renaming everything again.

Before you batch rename files, check this

  1. Copy the folder first

    On a batch of any size, work on a copy. Renaming is not undoable, and the cost is a few minutes of disk space.

  2. Check the sort order

    Whatever order the files are in is the order the numbering follows. Sort by date taken, not by the meaningless name you are replacing.

  3. Preview, then commit

    PowerRename shows results live; PowerShell has -WhatIf. Use whichever your tool offers, every time.

Needing to batch rename files is usually a symptom

If you are renaming files so you can find them, the underlying problem is often that they are all in one folder with no structure. Names are doing work that folders should be doing.

Part of a wider system for organizing files on Windows.

Renaming fails the same way deleting does when something still has the file open — the file is open in another program covers how to find the process actually holding it. And if the renaming is really an attempt to make files findable, what a file organizer does is worth reading first.

Was this useful?

Quick File Organizer

Folders that organize themselves, by your rules. Free, no account.

See Quick File Organizer

Keep reading

Know when the next app ships

1 more Windows utility is in development. One short email when each one is ready — nothing else.

Product releases only — roughly once a month. Unsubscribe any time.