Select files → hit Alt+F2 → type → done. No cloud. No telemetry. No 200 MB installer. Just one tiny tray app. 🪶
You pick 10 files in Explorer, press F2 to rename them all at once... and Windows names them all the same with a counter:
사진 (1).jpg 사진 (2).jpg 사진 (3).jpg 😭
But you didn't want that. You just wanted to slap 2024_ on the front. That's it.
win_rename keeps every original filename and just adds your prefix and/or suffix — with a live preview before anything touches the disk.
report.pdf → 2024_report_final.pdf (prefix "2024_", suffix "_final")
data.xlsx → 2024_data_final.xlsx
photo.jpg → 2024_photo_final.jpg
The suffix goes before the extension, so
.jpgstay intact. 👌
TL;DR — download the exe, double-click, press
Alt+F2in Explorer.
1. ⬇️ Just Install! win_rename.exe
No AutoHotkey. No setup. Nothing to clone.
Prefer the raw .ahk? You just need AutoHotkey v2 — a normal program installed once, system-wide (not per-folder, not inside the repo):
- 🏷️ Prefix + suffix in one shot — suffix lands before the extension
- ✂️ Remove text — strip a leading or trailing string before adding (re-prefix in one pass). Tick “
*wildcard” and_v*auto-removes versioned suffixes like_v1,_v2,_v3… - 🔢 Auto-increment counter — append
00001,00002, … before the extension; set the zero-padding & start number with the ▲▼ spinners - 👀 Live preview — see
old → newfor every file as you type - 🛡️ Safe by default — blocks illegal characters, never overwrites existing files, isolates per-file failures
- 🪟 Windows 11 tab-aware — reads the selection from the active Explorer tab, not a random one
- 🗂️ Files and folders
- ⌨️ Context-smart hotkey —
Alt+F2only fires in Explorer/Desktop; everywhere else the key behaves normally - 🪶 Featherweight — a single tray app, no background bloat
built-in F2 |
Renamer Alt+F2 |
|
|---|---|---|
| Keep original names | ❌ all become the same | ✅ |
| Add prefix | ❌ | ✅ |
| Add suffix (before extension) | ❌ | ✅ |
| Live preview | ❌ | ✅ |
| Folders too | ✅ |
⚙️ How it works (for the curious)
| Step | Mechanism |
|---|---|
| Hotkey scope | GroupAdd (CabinetWClass / WorkerW / Progman) + #HotIf WinActive("ahk_group …") — stays on the optimizer fast path |
| Read selection | enumerate Shell.Application.Windows → match the active window's HWND → on Win11, resolve the active tab via ShellTabWindowClass1 + IShellBrowser::GetWindow → Document.SelectedItems().Path |
| Name transform | SplitPath → prefix + nameNoExt + suffix + "." + ext |
| Rename | file FileMove(…, 0) / folder DirMove(…, "R"), each wrapped in try/catch |
Case-only renames (a.txt → A.txt) and cyclic swaps are handled via temporary names.
📦 Build the .exe yourself (optional — a prebuilt one is in Releases)
& "<path-to>\Ahk2Exe.exe" `
/in "win_rename.ahk" `
/out "win_rename.exe" `
/base "C:\Program Files\AutoHotkey\v2\AutoHotkey64.exe"
/basemust point at a v2 base file.
⚠️ Notes & gotchas
- Don't run as admin. If the app is elevated while Explorer isn't (the normal case), Windows hides the selection from it and you'll get an empty list. Renames in protected folders (Program Files, Windows, …) show up as per-file "Access Denied".
- Dotfiles (
.gitignore) are treated as extension-only, so affixes are prepended:2024__final.gitignore. The preview shows exactly what will happen. - Laptop F-row in media mode? Use
Fn+Alt+F2, or flip the firmware (BIOS) function-key setting. - SmartScreen may warn on the unsigned
.exethe first time → More info → Run anyway (or use Option B).
🧪 Tests
test_win_rename.ahk ships 59 automated tests (name transform, validation, counter, remove, * wildcard, on-disk rename engine, collisions, partial-failure isolation), and test_apply.ahk is a GUI integration test that clicks Apply and verifies an on-disk rename:
& "$env:LOCALAPPDATA\Programs\AutoHotkey\v2\AutoHotkey64.exe" test_win_rename.ahk
# report → %TEMP%\win_rename_test_result.txtThe .exe auto-registers on its first run, so it starts with Windows out of the box. Toggle it any time from the tray icon → Add / Remove from Startup (your choice is remembered).
It's portable, so cleanup is tiny. Run uninstall.bat (bundled in the release) — it stops the app, removes the startup shortcut + registry marker, and optionally deletes win_rename.exe. Prefer manual? Tray → Remove from Startup → Exit, then delete the file.
Issues and PRs welcome! Ideas: find & replace, case conversion, regex mode, drag-to-reorder.
If win_rename saved you from a rename rage-quit, drop a star — it genuinely helps. 🙌
MIT — do whatever, just keep the notice.
