PowerToys PowerRename utility for Windows (2024)

  • Article

PowerRename is a bulk renaming tool that enables you to:

  • Modify the file names of a large number of files, without giving all of the files the same name.
  • Perform a search and replace on a targeted section of file names.
  • Perform a regular expression rename on multiple files.
  • Check expected rename results in a preview window before finalizing a bulk rename.
  • Undo a rename operation after it is completed.

Demo

In this demo, all instances of the file name "foo" are replaced with "foobar". Since all of the files are uniquely named, this would have taken a long time to complete manually one-by-one. PowerRename enables a single bulk rename. Notice that the Explorer's "Undo Rename" (Ctrl+Z) command makes it possible to undo the last change.

PowerToys PowerRename utility for Windows (1)

PowerRename window

After selecting files in Windows File Explorer, right-click and select Rename with PowerRename (which will appear only if enabled in PowerToys). The selected items will be displayed, along with search and replace values, a list of options, and a preview pane displaying results of the search and replace values entered.

PowerToys PowerRename utility for Windows (2)

Search for

Enter text or a regular expression to find the files in your selection that contain the criteria matching your entry. You will see the matching items in the Preview pane.

Replace with

Enter text to replace the Search for value entered previously. You can see the original file name and renamed file name in the Preview pane.

Use regular expressions

If selected, the Search value will be interpreted as a regular expression (regex). The Replace value can also contain regex variables (see examples below). If cleared, the Search value will be interpreted as plain text to be replaced with the text in the Replace field.

For more information regarding the Use Boost library option in the settings menu for extended regex functionalities, see the regular expressions section.

Match all occurrences

If selected, all matches of text in the Search field will be replaced with the Replace text. Otherwise, only the first instance of the Search for text in the file name will be replaced.

For example, given the file name: powertoys-powerrename.txt:

  • Search for: power
  • Rename with: super

The value of the renamed file would result in:

  • Match all occurrences cleared: supertoys-powerrename.txt
  • Match all occurrences selected: supertoys-superrename.txt

Case sensitive

If selected, the text specified in the Search field will only match text in the items if the text is the same case. Case matching will be insensitive by default.

Apply to: Filename only

Only the file name is modified by the operation. For example: txt.txtNewName.txt.

Apply to: Extension only

Only the file extension is modified by the operation. For example: txt.txttxt.NewExtension.

Include files

Clearing causes files to not be included in the operation.

Include folders

Clearing causes folders to not be included in the operation.

Include subfolders

Clearing causes files within folders to not be included in the operation. By default, all subfolder items are included.

Text formatting

Choose between four options to either convert items to be all lowercase, all uppercase, title case (first character of sentence is capitalized), or capitalize every word.

Enumerate items

If selected, you can use the following patterns as part of the Replace with text:

Variable patternExplanation
${}A simple counter that will start from zero for the first renamed file.
${increment=X}A counter with a customized incrementer value.
${padding=X}A counter with a specified number of leading zeroes for the number.
${start=X}A counter with a customized initial value.

You can also use multiple counters in the same replace string and combine customizations.

For example, given a Search text a and a set of files:

  • a.jpg
  • ab.jpg
  • abc.jpg

A Replace with text Image_${padding=4;increment=2;start=10}_ would produce the following:

  • Image_0010_.jpg
  • Image_0012_b.jpg
  • Image_0014_bc.jpg

Random string values

If selected, you can use the following patterns as part of the Replace with text:

Variable patternExplanation
${rstringalnum=X}Random string with uppercase letters, lowercase letters and 0-9 digits, customized length.
${rstringalpha=X}Random string with uppercase letters and lowercase letters, customized length.
${rstringdigit=X}Random string with 0-9 digits, customized length.
${ruuidv4}Random UUID according to v4 specification.

By default, random string values created are mixed case. You can adjust the generating behavior with the general text formatting options that PowerRename provides.

If you wish to create UUID values with braces, you can add { and } to the Replace with input in combination with the ruuidv4 pattern accordingly: {${ruuidv4}}.

Replace using file creation date and time

The creation date and time attributes of a file can be used in the Replace with text by entering a variable pattern according to the table below. Selecting the tool-tip in the Replace with field allows you to view and select from the supported patterns.

Variable patternExplanation
$YYYYYear, represented by a full four or five digits, depending on the calendar used.
$YYYear, represented only by the last two digits. A leading zero is added for single-digit years.
$YYear, represented only by the last digit.
$MMMMName of the month.
$MMMAbbreviated name of the month.
$MMMonth, as digits with leading zeros for single-digit months.
$MMonth, as digits without leading zeros for single-digit months.
$DDDDName of the day of the week.
$DDDAbbreviated name of the day of the week.
$DDDay of the month, as digits with leading zeros for single-digit days.
$DDay of the month, as digits without leading zeros for single-digit days.
$hhHours, with leading zeros for single-digit hours.
$hHours, without leading zeros for single-digit hours.
$mmMinutes, with leading zeros for single-digit minutes.
$mMinutes, without leading zeros for single-digit minutes.
$ssSeconds, with leading zeros for single-digit seconds.
$sSeconds, without leading zeros for single-digit seconds.
$fffMilliseconds, represented by full three digits.
$ffMilliseconds, represented only by the first two digits.
$fMilliseconds, represented only by the first digit.

For example, given the file names:

  • powertoys.png, created on 11/02/2020 (november second)
  • powertoys-menu.png, created on 11/03/2020 (november third)

Enter the criteria to rename the items:

  • Search for: powertoys
  • Rename with: $MMM-$DD-$YY-powertoys

The value of the renamed file would result in:

  • Nov-02-20-powertoys.png
  • Nov-03-20-powertoys-menu.png

Regular expressions

For most use cases, a simple search and replace is sufficient. There may be occasions, however, in which complicated renaming tasks require more control. Regular Expressions can help.

Regular Expressions define a search pattern for text. They can be used to search, edit and manipulate text. The pattern defined by the regular expression may match once, several times, or not at all for a given string. PowerRename uses the ECMAScript grammar, which is common amongst modern programming languages.

To enable regular expressions, select Use Regular Expressions. Note: You will likely want to select Match all occurrences while using regular expressions.

To use the Boost library instead of the standard library, select the Use Boost library option in the PowerToys settings. It enables extended features, like lookbehind, which are not supported by the standard library.

Examples of regular expressions

Simple matching examples.

Search forDescription
^Match the beginning of the filename (zero size)
$Match the end of the filename (zero size)
.*Match all the text in the name
^fooMatch text that begins with "foo"
bar$Match text that ends with "bar"
^foo.*bar$Match text that begins with "foo" and ends with "bar"
.+?(?=bar)Match everything up to "bar"
foo[\s\S]*barMatch everything between and including "foo" and "bar"

Matching and variable examples. Capturing groups are defined in parentheses (). To refer to them, use $ followed by a number: $1 will refer to the first group, $2 to the second etc.When using the variables, "Match all occurrences" must be selected.

Search forReplace withDescription
(.*).pngfoo_$1.pngPrepends "foo_" to the existing file name for PNG files
(.*).png$1_foo.pngAppends "_foo" to the existing file name for PNG files
(.*)$1.txtAppends ".txt" extension to existing file
(^\w+\.$)\|(^\w+$)$2.txtAppends ".txt" extension to existing file name only if it does not have an extension
(\d\d)-(\d\d)-(\d\d\d\d) or (\d{2})-(\d{2})-(\d{4})$3-$2-$1Move parts in the filename: "29-03-2020" becomes "2020-03-29"
^(.{n})(.*) or (.*)(.{n})$$1foo$2Insert "foo" n characters from the beginning or the end, respectively
^.{n} or .{n}$nothingTrim n characters from the beginning or the end, respectively

Additional resources for learning regular expressions

There are great examples/cheatsheets available online to help you:

Regular Expression Tutorial

JavaScript Regular Expressions Tutorial with Examples

File list filters

Filters can be used in PowerRename to narrow the results of the rename. Use the Preview pane to check expected results.

  • Original, the first column in the Preview pane switches between:

    • Selected: The file is selected to be renamed
    • Cleared: The file is not selected to be renamed (even though it fits the value entered in the search criteria)
  • Renamed, the second column in the Preview pane can be toggled:

    • The default preview will show all selected files, with only files matching the Search for criteria displaying the updated rename value.
    • Selecting the Renamed header will toggle the preview to only display files that will be renamed. Other selected files from your original selection will not be visible.

PowerToys PowerRename utility for Windows (3)

Settings

Additional options can be configured in the settings, as described below:

SettingDescription
Show PowerRename inPowerRename appears as one of the default options or only in the extended context menu
Hide icon in context menuHides the PowerRename icon in the context menu
Enable auto-complete for the search and replace fieldsAutomatically suggest terms to use in the search and replace fields based on prior uses of PowerRename
Maximum number of itemsThe largest number of search and replace suggestions to display
Show recently used stringsWhen opening PowerRename, populate the search and replace fields with the last values used
Use Boost libraryEnable extended regex functionality. See Regular Expressions for more details

Install PowerToys

This utility is part of the Microsoft PowerToys utilities for power users. It provides a set of useful utilities to tune and streamline your Windows experience for greater productivity. To install PowerToys, see Installing PowerToys.

PowerToys PowerRename utility for Windows (2024)
Top Articles
Angular — Reading data from JSON file using HttpClient
Find Legal Help
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
How To Cut Eelgrass Grounded
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Umn Biology
Obituaries, 2001 | El Paso County, TXGenWeb
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Colin Donnell Lpsg
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Used Curio Cabinets For Sale Near Me
San Pedro Sula To Miami Google Flights
Selly Medaline
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 6414

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.