Home/Blog/Tutorials/How to Batch Remove Special Characters from Filenames in Windows 11: 4 Methods Compared
TutorialsBeginner12 min read

How to Batch Remove Special Characters from Filenames in Windows 11: 4 Methods Compared

Renomee Team

Published on June 12, 2026

How to Batch Remove Special Characters from Filenames in Windows 11: 4 Methods Compared

Have you ever encountered these situations?

  • Downloaded videos from cloud storage with filenames like 【4K BluRay】Iron Man (2008) [IMAX Edition][Dual Audio].mkv, cluttered with brackets and square brackets
  • Files copied from macOS or Linux containing :, / and other characters Windows doesn't recognize
  • Scanner output files with auto-generated Chinese parentheses like (1) (2)
  • Batch-downloaded academic papers with citation info like [doi:10.1038/...] embedded in filenames

These "polluted characters" make files look messy at best, and at worst cause programs to fail reading them, cross-platform transfer errors, or batch script failures.

This guide tests 4 batch cleanup methods to find the most efficient approach. If you have no programming background and need to process 100+ files, jump straight to the Renomee batch rename tool section.


Quick Comparison: 4 Methods at a Glance

Your SituationRecommended Method
Fewer than 20 files, one-time taskWindows F2 manual rename
Programming background, complex rules, need reusable scriptsPowerShell scripts
No programming background, willing to learn basic regexPowerRename (free)
No programming background, large file count, need safe undoRenomee (zero learning curve)

💡 Quick decision: If you have 100+ files to clean and don't want to learn regex, jump directly to Method 4: Renomee or download Renomee.


First: Which Characters Need Removal?

Before processing, distinguish between two types of characters:

Type 1: Illegal Windows System Characters (Must Remove)

Windows strictly forbids these 9 characters in filenames:

CharacterPurpose
\Path separator
/Path separator (Unix-style)
:Drive letter separator
*Wildcard
?Wildcard
"String quotes
<Redirection operator
>Redirection operator
``

Files containing these characters typically come from macOS/Linux systems or were created through special methods. Windows normally cannot create files with these characters, but may preserve them when receiving files.

Type 2: "Polluting" Characters (Optional Cleanup)

Characters that don't break the system but make filenames messy:

Character TypeExampleSource
English parentheses(2008) (HD)Video download sites, manual notes
Chinese parentheses(Complete) (Copy)Chinese download sites, Office auto-naming
English brackets[IMAX] [1080P]Subtitle groups, video sites
Chinese brackets【Exclusive】 【First Release】Cloud sharing
Extra spacesFile Name (2).pdfAuto-generated or typos
Stacked periodsFile...Name.pdfBatch downloads
Special symbols# @ & $ %Web downloads, code-related

Common Scenarios and Cleanup Goals

ScenarioTypical Problem CharactersCleanup Goal
Cloud/torrent video downloads【】[]() site watermarksKeep main filename, remove decorative characters
Files from macOS: / \ path charactersReplace with - or _
Scanner output(1)(2) auto-numberingReplace with unified numbering format
Batch-downloaded PDFs[doi:...] citation suffixesRemove brackets and their contents
Mixed Chinese documentsFull-width symbols, full-width spacesNormalize to half-width or remove

Method 1: Manual F2 (For 20 Files or Fewer)

Directly rename in File Explorer by pressing F2, manually delete special characters.

Tested time (100 files): ~25 minutes
Best for: Temporary cleanup of small file batches, not worth configuring tools

Only tip worth mentioning: In the rename input box, Ctrl+A selects all filename content, convenient for complete replacement.


Method 2: PowerShell Scripts (Free, Customizable)

PowerShell's -replace operator supports regular expressions, perfect for batch character cleanup.

Basic Script: Remove All Brackets (English and Chinese)

# Batch remove brackets from filenames (English and Chinese parentheses and square brackets)
$folder = "D:\TargetFolder"   # Change to your folder path

Get-ChildItem -Path $folder -File | ForEach-Object {
    # Separate filename and extension
    $baseName = [System.IO.Path]::GetFileNameWithoutExtension($_.Name)
    $ext = $_.Extension

    # Remove all bracket characters (and their contents)
    $newBase = $baseName -replace '\(.*?\)', ''   # Remove English parentheses and contents
    $newBase = $newBase -replace '\[.*?\]', ''    # Remove English brackets and contents
    $newBase = $newBase -replace '(.*?)', ''    # Remove Chinese parentheses and contents
    $newBase = $newBase -replace '【.*?】', ''    # Remove Chinese brackets and contents

    # Clean extra spaces (merge consecutive spaces, trim leading/trailing)
    $newBase = $newBase -replace '\s+', ' '
    $newBase = $newBase.Trim()

    $newName = $newBase + $ext

    # Only rename if filename changed and not just extension
    if ($newName -ne $_.Name -and $newName -ne $ext) {
        Rename-Item -Path $_.FullName -NewName $newName
        Write-Host "✅ $($_.Name) → $newName"
    }
}
Write-Host "Processing complete!"

Advanced Script: Clean Windows Illegal Characters

# Clean illegal characters in Windows filenames (from other systems)
$folder = "D:\TargetFolder"

Get-ChildItem -Path $folder -File | ForEach-Object {
    $baseName = [System.IO.Path]::GetFileNameWithoutExtension($_.Name)
    $ext = $_.Extension

    # Replace all Windows illegal characters with underscores
    $newBase = $baseName -replace '[\\/:*?"<>|]', '_'

    # Optional: merge consecutive underscores
    $newBase = $newBase -replace '_+', '_'
    $newBase = $newBase.Trim('_')

    $newName = $newBase + $ext

    if ($newName -ne $_.Name) {
        Rename-Item -Path $_.FullName -NewName $newName
        Write-Host "✅ $($_.Name) → $newName"
    }
}

Universal Script: One-Time Cleanup of All Common Polluting Characters

# Universal filename cleanup script
# Functions: Remove brackets and contents, clean extra spaces, replace illegal characters, trim leading/trailing underscores
$folder = "D:\TargetFolder"   # Change to your path
$dryRun = $true               # Change to $false to actually execute renames

Get-ChildItem -Path $folder -File | ForEach-Object {
    $baseName = [System.IO.Path]::GetFileNameWithoutExtension($_.Name)
    $ext = $_.Extension

    $new = $baseName
    $new = $new -replace '\(.*?\)', ''     # English parentheses and contents
    $new = $new -replace '\[.*?\]', ''     # English brackets and contents
    $new = $new -replace '(.*?)', ''     # Chinese parentheses and contents
    $new = $new -replace '【.*?】', ''     # Chinese brackets and contents
    $new = $new -replace '[\\/:*?"<>|]', '_'  # Windows illegal characters
    $new = $new -replace '\s+', ' '        # Merge extra spaces
    $new = $new -replace '_+', '_'         # Merge extra underscores
    $new = $new.Trim()
    $new = $new.Trim('_')

    $newName = if ($new) { $new + $ext } else { $_.Name }  # Prevent empty filenames

    if ($newName -ne $_.Name) {
        if ($dryRun) {
            Write-Host "[Preview] $($_.Name) → $newName"
        } else {
            Rename-Item -Path $_.FullName -NewName $newName
            Write-Host "✅ $($_.Name) → $newName"
        }
    }
}

if ($dryRun) {
    Write-Host ""
    Write-Host "⚠️  Currently in preview mode, not actually executed. After confirming, change dryRun to `$false and run again."
}

How to use: First run with $dryRun = $true to preview output, confirm results match expectations, then change to $dryRun = $false to execute actual renames.

PowerShell Method Test Results (1000 Files)

  • ⏱️ Execution time: ~15 seconds
  • 🎯 Best for: Users with technical background needing precise control over cleanup rules
  • ⚠️ Note: Wrong regex will cause batch filename corruption, always preview first with $dryRun = $true

Method 3: PowerToys PowerRename (Free GUI)

If you don't want to write code, use Microsoft's free PowerRename tool in PowerToys—supports regular expressions, has real-time preview, visual operation.

Installation

Search "PowerToys" in Microsoft Store for free installation, or download from github.com/microsoft/PowerToys.

After installation, right-click selected files → "Rename with PowerRename" to open the interface.

Using PowerRename to Remove Brackets and Contents

Remove English square brackets and contents (like [1080P]):

FieldInput Value
Search\[.*?\]
Replace with(leave empty)
☑ Use regular expressionsCheck

Remove all bracket types and contents (one time):

FieldInput Value
Search[\(\[(【].*?[\)\])】]
Replace with(leave empty)
☑ Use regular expressionsCheck

Replace spaces with underscores:

FieldInput Value
Search (space)
Replace with_
No need to check regex

PowerRename's Real-Time Preview

PowerRename's biggest advantage is seeing each file's "before → after" effect before execution, preventing regex errors from causing batch filename damage.

Tested time (1000 files):

  • Open interface + input rules: ~1 minute
  • Execute: ~18 seconds
  • Total ~1.5 minutes

PowerRename's Limitations

  • ❌ Regex syntax still has learning curve (not friendly to non-technical users)
  • ❌ Multiple cleanup rules need multiple executions (only one rule can be applied at a time)
  • ❌ No operation history, cannot one-click undo (relies on Ctrl+Z)

For a complete PowerRename guide, see: Windows 11 Right-Click Rename Complete Guide


Method 4: Renomee AI Batch Rename Tool (Zero Learning Curve)

Core Advantages

Describe cleanup needs in natural language, AI understands and processes automatically—no need to memorize regex syntax or write scripts. Download Renomee now

Real Operation Examples

Operation 1: Remove Download Site Watermarks

File: 【BluRay 4K】Iron Man (2008) [IMAX Edition][Dual Audio].mkv

Renomee input:

Remove all brackets (including English and Chinese parentheses and square brackets) and their contents, keep main title

Result: Iron Man.mkv


Operation 2: Clean Illegal Characters from macOS

File: Project Report: 2026/Q2_Financial Analysis.xlsx

Renomee input:

Replace colons and slashes in filenames with hyphens

Result: Project Report-2026-Q2_Financial Analysis.xlsx


Operation 3: Batch Normalize Messy Filenames

File list:

  Report (1) .pdf
Report  (2).pdf
【Important】Report(3)【2026】.pdf

Renomee input:

Clean filenames: remove all brackets and their contents (including English and Chinese formats),
merge extra spaces, trim leading/trailing spaces, keep core filename

Result:

Report.pdf
Report.pdf (add number if duplicate)
Report.pdf

Speed Comparison (1000 Files, Mixed Rule Cleanup)

MethodRule Prep TimeExecution TimeTotal Time
Manual F2~250 minutes~250 minutes
PowerShell script (first time)~15 minutes~15 seconds~15 minutes
PowerRename~1 minute~18 seconds~1.5 minutes
Renomee~20 seconds~12 seconds~35 seconds

4-Method Cross Comparison

ComparisonManual F2PowerShellPowerRenameRenomee
Learning curveZero⚠️ Need script basics⚠️ Need regex basics✅ Zero
Free✅ (needs PowerToys)✅ (free tier)
Preview⚠️ Need -WhatIf✅ Real-time✅ Real-time
One-click undo⚠️ Ctrl+Z only
Speed (1000 files)Very slow15s18s12s
Compound rules support⚠️ Need multiple runs
Prevent empty filenamesNeed manual logic✅ Auto-handled

3 Must-Do Things Before Execution

1. Backup Original Files

Before any batch operation, copy a backup first:

# Quick backup entire folder
Copy-Item -Path "D:\OriginalFolder" -Destination "D:\Backup_OriginalFolder" -Recurse

Or simply use Windows "Copy → Paste" to copy the entire folder to another location.

2. Test on 10 Files First

Take 10 representative files from your target set (including various special characters you expect), execute cleanup on these 10 files first, confirm results match expectations.

Special attention: Check if any filenames become empty after cleanup (filenames consisting entirely of special characters will become empty).

3. Check for Duplicate Names

After cleanup, multiple files may have identical names (e.g., (1)Version.pdf, (2)Version.pdf both become Version.pdf).

Windows doesn't allow duplicate filenames in the same folder, solutions:

  • Keep numbering during cleanup (like "Version 1.pdf" "Version 2.pdf")
  • Or use tools that auto-detect duplicates and append numbers

Special Scenario Handling Tips

Scenario: Only Remove Brackets, Keep Contents

Sometimes bracket contents are useful (like dates, version numbers), you only want to remove the bracket symbols themselves while keeping the contents.

PowerShell:

# Remove brackets, keep contents
$new = $baseName -replace '[\(\[(【]', ''   # Remove left brackets
$new = $new -replace '[\)\])】]', ''         # Remove right brackets

Renomee input:

Remove bracket symbols themselves (including English and Chinese parentheses and square brackets), but keep text content inside brackets

Scenario: Replace Special Characters (Not Remove)

Sometimes direct removal makes filenames unclear, better to replace with hyphens or underscores.

Renomee input:

Replace all brackets (including English and Chinese) in filenames with hyphens -,
merge multiple consecutive hyphens into one, trim leading/trailing hyphens

Example:

  • Iron Man(2008)[IMAX].mkvIron-Man-2008-IMAX.mkv

Scenario: Process Only Specific File Types

If you only want to clean PDF files in a folder, leave other formats untouched:

PowerShell:

Get-ChildItem -Path $folder -Filter "*.pdf" | ForEach-Object { ... }

Renomee input:

Only process PDF files in folder, remove brackets from filenames, leave other formats untouched

Frequently Asked Questions

Q: What if filenames become just the extension after cleanup (like .pdf)?

This means the original filename consisted entirely of special characters, becoming empty after cleanup. Solutions:

  • Add logic to script: if ($new) { ... } else { $_.Name } (keep original)
  • Or give these files a unified default name (like "File_Number.pdf")

Q: Are Chinese and English brackets different, need separate processing?

Yes, they are different characters in computers:

  • English brackets: ( ) [ ] (half-width, ASCII characters)
  • Chinese brackets: (full-width, Unicode characters)

Regular expressions need to match them separately, or use character class [\(\[(【] to match all types at once.

Q: Should I remove Emoji or special Unicode characters from filenames?

Windows 11's NTFS file system supports most Unicode characters (including Emoji), theoretically no need to remove. But if files need to:

  • Upload to legacy systems (servers that don't support special Unicode)
  • Send via email (some email systems truncate special characters)
  • Process in batch scripts (Emoji may cause script encoding issues)

Then it's recommended to remove or replace Emoji and uncommon Unicode characters.


Summary

Your SituationRecommended Method
Fewer than 20 files, one-time taskWindows F2 manual rename
Programming background, complex rules, need reusable scriptsPowerShell scripts
No programming background, willing to learn basic regexPowerRename (free)
No programming background, large file count, need safe undoRenomee (zero learning curve)

Most common mistake: Executing without preview—regardless of which method you use, always test on a small file set first, confirm the rule works correctly before batch processing.


Try Renomee Batch Cleanup Tool Now

If you have a batch of filenames needing cleanup, download Renomee batch rename tool for free:

  • ✅ Describe cleanup needs in plain English, zero regex learning curve
  • ✅ Real-time preview of "before → after" results for each file before execution
  • ✅ Complete operation history + one-click undo, recover from mistakes
  • ✅ Free tier with 20 daily operations, no registration required


Last updated June 12, 2026. Questions? Discuss in the Renomee Community.

Tags

#batch rename#special characters#filename cleanup#Windows 11#PowerRename#file management#productivity tools

About the Author

The Renomee team is dedicated to providing users with the best file management solutions, sharing practical tips and in-depth technical articles.

Start Using Renomee

Download Renomee and experience smart file management today