DEV Community

loading...
Cover image for Easily Bulk Rename Files on Windows

Easily Bulk Rename Files on Windows

denvercoder1 profile image Jonah Lawrence Originally published at jonahlawrence.hashnode.dev ・2 min read

In this tutorial, I will show you how to rename several files at once in Windows 10. You not only can append text to filenames, but you can even create advanced regular expressions or enumerate your files. There are also text transformations available to make your filenames all uppercase or lowercase.

To get started, I will be using PowerRename which is part of Microsoft PowerToys.

GitHub logo microsoft / PowerToys

Windows system utilities to maximize productivity

Microsoft PowerToys

Downloads & Release notes | Contributing to PowerToys | What's Happening | Roadmap

Build status

Architecture Master Stable Installer
x64 Build Status for Master Build Status for Stable Build Status for Installer

About

Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows 10 experience for greater productivity. For more info on PowerToys overviews and guides, or any other tools and resources for Windows development environments, head over to docs.microsoft.com!

Installing and running Microsoft PowerToys

Requirements

  • Windows 10 v1903 (build 18362) or better preferred, Windows 10 v1803 (build 17134) minimum.
  • Have .NET Core 3.1 Desktop Runtime. The installer should handle this but we want to directly make people aware.

Via GitHub with EXE [Recommended]

Stable version

Install from the Microsoft PowerToys GitHub releases page. Click on Assets to…

You can install PowerToys by heading to this link and downloading the executable for the latest release (as of writing this, it's called PowerToysSetup-0.31.2-x64.exe)

Once it's installed, you should be able to see PowerRename as an option in your Right-click menu when selecting files in your File Explorer.

image

Once you click that, you should see a popup come up with a search box, replace box, some options, and a preview.

image

To make a simple word replacement, you can type the word to search for in the first box, the word to replace it with in the second box, preview the results, and click "Rename".

easy gif

If you want more complex replacements, such as matching several different words or characters, reordering parts of the filename, or duplicating sections, you can do that with Regular Expressions.

For example, to match the words "Lab" or "Lecture" in a filename, we can use (Lab|Lecture) in our search text. Just make sure to click the box for "Use Regular Expressions."

To rearrange parts of a filename, you can reference capturing groups in the replace text.

For example, if you had files that all ended with a 2-digit number and you wanted to move it to the beginning, your search text may be in the form (.*)(\d\d) and you could replace it with $2$1 where $2 is the second capturing group, (\d\d), and $1 is the first capturing group, (.*).

In my video, How to Bulk Rename Files Easily on Windows, I show how it is possible to reorder parts of a filename, add padding zeroes, and change date formats with just a few simple replacements.

Be sure to check it out and subscribe for more tips!

Thanks for your support!

- Jonah Lawrence

🐦 @DenverCoder1

📺 Jonah Lawrence • Dev Pro Tips

Discussion (0)

pic
Editor guide