A simple Windows batch script that automatically renames files in-place: replaces spaces with hyphens, converts Polish characters to ASCII, removes other special characters, converts filenames to lowercase, preserves extensions, and skips the script itself for safe, clean filenames.
- Replaces spaces with hyphens (
-) - Converts Polish characters (ą, ć, ę, ł, ń, ó, ś, ź, ż) to ASCII
- Converts filenames to lowercase
- Removes all other special characters (keeps letters, numbers, hyphens, and dots)
- Preserves file extensions
- Skips the batch script itself to avoid renaming itself
- Not recursive - only renames files in the current folder (subfolders are ignored)
- Download or clone this repository.
- Place
rename_files.batin the folder containing the files you want to rename. - Double-click the
.batfile to run it. - All files in the folder will be renamed automatically.
- The script will rename only the files in that folder (subfolders remain untouched).
Before running the script:
Świąteczny plik 2025!.txt
Mój (dokument).pdf
After running the script:
swiateczny-plik-2025.txt
moj-dokument.pdf