Skip to content

xecvas/FileRenamer

Repository files navigation

File Renamer

A lightweight, modern WPF desktop application for batch renaming or copying files with find-and-replace text matching, regex support, live preview, and one-click restore.

Platform Framework Language UI License

Overview

File Renamer is a Windows desktop utility built with C# and WPF (.NET Framework 4.8) for quickly batch-renaming or batch-copying files in a folder. It wraps simple find-and-replace or regex-based matching in a clean, frameless, themeable UI, shows a live preview of the resulting filenames before you commit, and can generate a restore log so any batch operation can be undone with a single click.

Features

  • Rename in-place or copy to a new folder — apply changes directly to the source folder, or copy matching files (renamed) into a separate output folder, leaving the originals untouched.
  • Find & replace or regex matching — match filenames with plain text substrings or full regular expressions, with immediate validation of regex syntax.
  • Built-in presets — 10 one-click presets for common cleanup tasks: Standard Replace, Remove Brackets, Remove Numbers, Remove Symbols, Remove Extra Spaces, Trim Leading/Trailing Spaces, Spaces to Underscores, Spaces to Dashes, Remove Leading Track Numbers, and Custom Regex.
  • Live rename preview — see exactly how a sample filename will be transformed as you type, with a cheat-sheet panel for regex presets.
  • File type filtering — restrict operations to a specific extension or wildcard filter.
  • Restore log & one-click undo — optionally generate a rename_log.csv for every batch run, then use Restore to revert renames or delete copies and roll back the operation.
  • Collision-safe copying — if two files would resolve to the same output name in a single Copy batch, the duplicate is safely skipped and flagged as Failed instead of silently overwriting the first file's output.
  • Cancellable batch operations — long-running batches execute asynchronously and can be cancelled mid-run without leaving the UI unresponsive.
  • Live results grid — every processed file is logged with its status (Renamed, Copied, Restored, Failed, etc.), auto-scrolling to the latest entry.
  • Audible alerts — optional sound notification when a batch operation completes.
  • Light & dark themes — toggle between light and dark UI themes, applied dynamically via frozen WPF brushes for smooth rendering, with all labels (including mode/option controls) following the active theme.
  • Custom window chrome — frameless, draggable title bar for a modern look.
  • Persistent settings — theme preference is automatically saved to and restored from %LocalAppData%\File Renamer\settings.json.

Screenshots

File Renamer 1 File Renamer 2

Getting Started

Prerequisites

  • Windows 7 SP1 or later (Windows 10/11 recommended)
  • .NET Framework 4.8 (typically pre-installed on modern Windows)
  • Visual Studio 2019/2022 with the .NET desktop development workload (only required to build from source)

Build from source

  1. Clone the repository:
    git clone https://github.com/xecvas/FileRenamer.git
    cd FileRenamer
  2. Open File Renamer.sln in Visual Studio.
  3. Build the solution (Ctrl+Shift+B) or publish a Release build.
  4. Run File Renamer.exe from bin/Release (or bin/Debug).

Download a release

Alternatively, download the latest pre-built executable from the Releases page and run File Renamer.exe directly — no installation required.

Usage

  1. Launch File Renamer.
  2. Click Browse to select a Source Folder containing the files you want to process.
  3. Choose Rename in-place to modify files directly, or Copy to new folder and select an Output Folder to leave originals untouched.
  4. Enter the text (or regex pattern) to Find and what to Replace it with, or open Advanced Setting to pick a ready-made preset (Remove Brackets, Remove Numbers, Remove Symbols, Remove Extra Spaces, Trim Spaces, Spaces to Underscores, Spaces to Dashes, Remove Leading Track Numbers, or Custom Regex).
  5. Optionally set a file extension/filter, enable Create restore log, and enable Play sound notification.
  6. Click Rename to run the batch. Results stream into the grid in real time with a status per file.
  7. Click Cancel at any time to halt a running batch.
  8. If a restore log exists for the selected folder, click Restore to undo the last batch (reverting renames or removing copies).

Your theme preference is remembered automatically between sessions.

Changelog

Recent fixes & additions:

  • Fixed: opening/reopening the Advanced Setting panel while on "Standard Replace" or "Custom Regex" no longer wipes out text you'd already typed into Find.
  • Fixed: in Copy mode, if two files would resolve to the same output filename in one batch, the second no longer silently overwrites the first — it's now reported as Failed and the first file's copy is preserved.
  • Fixed: clicking into a text field no longer permanently disables the window's auto-recenter behavior (only an actual drag does).
  • Fixed: Rename in-place, Copy to new folder, Create restore log, and Play sound notification labels now correctly switch to white text in dark mode instead of staying black.
  • Added: 5 new presets — Remove Extra Spaces, Trim Leading/Trailing Spaces, Spaces to Underscores, Spaces to Dashes, and Remove Leading Track Numbers.

Project Structure

File Renamer/
├── Models/
│   ├── Models.cs              # RenameConfig, LogEntry, and ProgressData data models
│   └── Services.cs            # FileOperationService — core rename/copy/restore engine
├── Utilities/
│   └── RenamerHelper.cs       # Win32 folder browser dialog helper
├── assets/                    # Icons and images
├── App.xaml / App.xaml.cs     # Application entry point
├── AppSettings.cs             # Persisted user settings (load/save as JSON)
├── AboutWindow.xaml / .xaml.cs# About dialog
└── MainWindow.xaml / .xaml.cs # Main UI and interaction logic

Built With

  • C# / WPF on .NET Framework 4.8
  • System.IO / System.Text.RegularExpressions — file enumeration and pattern matching
  • System.Web.Script.Serialization.JavaScriptSerializer — settings persistence
  • System.Windows.Forms.FolderBrowserDialog — folder picker

Contributing

Contributions are welcome! If you'd like to contribute:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/my-feature).
  3. Commit your changes (git commit -m "Add my feature").
  4. Push to the branch (git push origin feature/my-feature).
  5. Open a Pull Request.

Please keep changes consistent with the existing .NET Framework 4.8 / WPF target and avoid introducing dependencies on newer .NET runtimes.

License

This project is licensed under the terms found in LICENSE.txt.

Author

Created with ❤️ by xecvas

About

A lightweight, modern WPF desktop application for batch renaming or copying files with find-and-replace text matching, regex support, live preview, and one-click restore.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages