Activation
PowerRename appears as a context menu item only when files or folders are selected in File Explorer.
Core Features
Search and Replace
- Simple Text
- Case Options
- Empty Replace
Basic text search and replace:Search for:
vacationReplace with: holidayResult: vacation_2024.jpg → holiday_2024.jpgRegular Expressions
PowerRename supports full regex patterns for advanced renaming operations.Enable Regular Expressions
Enable Regular Expressions
Check the Use regular expressions option to enable regex mode.
Common Regex Patterns
Renaming Options
Search and Replace
Search and Replace
- Match all occurrences: Replace every match in the filename (not just the first)
- Case sensitive: Treat uppercase and lowercase as different
- Use regular expressions: Enable regex pattern matching
Apply To
Apply To
Choose what parts of the filename to rename:
- Filename + Extension: Rename the entire filename
- Filename only: Keep file extensions unchanged (recommended)
- Extension only: Change only file extensions
Text Formatting
Text Formatting
- Make uppercase: Convert matched text to UPPERCASE
- Make lowercase: Convert matched text to lowercase
- Make titlecase: Capitalize The First Letter Of Each Word
Item Selection
Item Selection
- Include files: Rename files
- Include folders: Rename folders
- Include subfolders: Process items in subdirectories
- Exclude items: Skip specific files or folders using patterns
Live Preview
PowerRename shows a live preview of all rename operations before you apply them.- Preview List
- Preview Filtering
The preview list shows:
- Original filename (left column)
- New filename after rename (right column)
- Checkboxes to include/exclude individual items
- Highlighted differences between old and new names
Pattern Snippets
PowerRename includes pattern snippets for common renaming scenarios. Implementation:/src/modules/powerrename/PowerRenameUILib/PatternSnippet.cpp
Variable Substitution
Use special variables in the “Replace with” field:| Variable | Description | Example |
|---|---|---|
$num | Sequential number (1, 2, 3…) | file_$num.txt → file_1.txt |
$001num | Zero-padded number | file_$001num.txt → file_001.txt |
$date | Current date (YYYY-MM-DD) | backup_$date.zip |
$time | Current time (HH-MM-SS) | log_$time.txt |
$parent | Parent folder name | $parent_file.txt |
Variables are case-sensitive and must be typed exactly as shown.
Advanced Use Cases
Batch Photo Renaming
Batch Photo Renaming
Rename vacation photos with dates:Files:Pattern:
- Search:
IMG_(\d+) - Replace:
Vacation_2024_$1 - Use regex: Yes
Clean Up Downloaded Files
Clean Up Downloaded Files
Remove website names and tracking codes:Files:Pattern:
- Search:
\s*\(\d+\)|\s+copy|-download-[a-z0-9]+ - Replace: (empty)
- Use regex: Yes
Add Sequential Numbers
Add Sequential Numbers
Add sequential numbering to files:Pattern:
- Search:
^(.+)(\..+)$ - Replace:
$1_$001num$2 - Use regex: Yes
Change File Extensions
Change File Extensions
Rename .txt files to .md:Settings:
- Search:
txt - Replace:
md - Apply to: Extension only
Extract and Reorganize
Extract and Reorganize
Extract date from filename and reorganize:Files:Pattern:
- Search:
Report_(\d{4})-(\d{2})-(\d{2})_v\d+ - Replace:
$1$2$3_Report - Use regex: Yes
Regex Reference
Common Patterns
| Pattern | Matches | Example |
|---|---|---|
. | Any single character | a.c matches abc, a1c |
* | Zero or more of previous | ab* matches a, ab, abb |
+ | One or more of previous | ab+ matches ab, abb |
? | Zero or one of previous | ab? matches a, ab |
\d | Any digit (0-9) | file\d matches file1 |
\w | Word character (a-z, 0-9, _) | \w+ matches file_1 |
\s | Whitespace (space, tab) | \s matches |
^ | Start of string | ^file matches start |
$ | End of string | txt$ matches end |
[abc] | Any character in brackets | [aeiou] matches vowels |
[^abc] | Not in brackets | [^0-9] matches non-digits |
(...) | Capture group | (\d+) captures numbers |
$1, $2 | Backreference to groups | Use captured text |
Special Escape Sequences
| Sequence | Meaning |
|---|---|
\. | Literal dot |
\\ | Literal backslash |
\( \) | Literal parentheses |
\[ \] | Literal brackets |
\^ \$ | Literal ^ or $ |
Configuration
Settings
Configure PowerRename behavior in PowerToys Settings:Default Options
Set default values for:
- Use regular expressions
- Case sensitivity
- Match all occurrences
Safety Features
Before Renaming
Before Renaming
- Always review the preview list carefully
- Test on a few files first before bulk operations
- Backup important files before major renaming
- Check that file extensions are preserved (if desired)
During Renaming
During Renaming
- Monitor the progress indicator
- Don’t interrupt the process on network drives
- Watch for error messages or conflicts
After Renaming
After Renaming
- Verify results in File Explorer
- If mistakes occur, use Ctrl+Z in File Explorer immediately
- Some applications may need to be restarted to recognize renamed files
Troubleshooting
Context Menu Not Showing
Context Menu Not Showing
Regex Not Working
Regex Not Working
- Verify “Use regular expressions” checkbox is enabled
- Check pattern syntax using online regex tester
- Escape special characters:
. * + ? ^ $ ( ) [ ] { } \ |
Some Files Not Renamed
Some Files Not Renamed
- Check if files are currently open in other applications
- Verify file permissions (read-only files cannot be renamed)
- Look for error messages in the preview list
- Some system files may be protected from renaming
Variables Not Substituting
Variables Not Substituting
- Ensure variables are typed exactly:
$num,$date, etc. - Variables are case-sensitive
- Some variables only work in replace field, not search field
Source Code
Location:/src/modules/powerrename/
- Context menu:
PowerRenameContextMenu/ - UI library:
PowerRenameUILib/ - Pattern snippets:
PowerRenameUILib/PatternSnippet.cpp - Explorer integration:
PowerRenameUILib/ExplorerItemsSource.cpp