Skip to content

ishaanman7898/FileRenamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Renamer (Long Path Helper)

A lightweight Windows utility to rename and safely delete files with excessively long names that cause OS errors.

Repository Summary (One-liner)

A lightweight Windows utility to rename and safely delete files with excessively long names that cause OS errors.


README Description

About the Project

When downloading files through web browsers, Windows users frequently encounter an issue where files with exceptionally long filenames cannot be deleted, moved, or renamed natively through File Explorer. This happens because Windows traditionally struggles with file paths that exceed the 260-character limit (known as MAX_PATH).

This utility solves that frustration. By bypassing standard File Explorer restrictions, the program allows you to quickly rename these problematic, large-named files down to a short string, enabling Windows to instantly and safely delete them thereafter.

Key Features

  • Bypass Windows Restrictions: Easily handle files blocked by traditional path-length limitations.
  • Streamlined Workflow: Rename and delete stubborn files directly inside the application interface.
  • Safe Clean-up: Perfect for cleaning up messy browser downloads without needing to mess with the Windows Registry or complex command-line tools.

Usage

Run from Python

If you have Python installed, run the app directly from the repo:

python filerenamer.py

Then:

  • Click "Select Files" to choose one or more files, or use "Add Path" to paste/open a single file path.
  • Select an entry, type a new name in the box, choose whether to keep the original extension, then click "Apply Rename".
  • To remove a stubborn file, select it and click "Delete Selected".

Run the standalone EXE

If you distribute the built dist\FileRenamer.exe, users do not need Python installed on their machine. The EXE includes the runtime dependencies needed to run the app.

New features

  • Modernized GUI using ttk controls and a file list with name-length display.
  • After renaming, if the new name (excluding extension) is under 25 characters the app can optionally prompt to delete the file (defaults to prompting). Deletions go to the Recycle Bin by default.

Build an EXE

You can bundle this into a single Windows executable using pyinstaller.

  1. Install build deps:
pip install -r requirements.txt
  1. Run the helper batch (Windows):
.\build_exe.bat

The built FileRenamer.exe will be inside the dist folder.

The standalone EXE can be copied to another Windows machine and run without installing Python.

Notes

  • This tool uses the Windows API (MoveFileW / DeleteFileW) via ctypes to support extended-length paths (the \\?\ prefix).
  • No extra packages required; uses the standard library's tkinter for the GUI. If your Python doesn't include tkinter, install the appropriate package for your distribution.
  • Run as a user with permissions to modify the target files.

If you want this packaged into a single executable for distribution, I can add a pyinstaller spec.

About

A lightweight Windows utility to rename and safely delete files with excessively long names that cause OS errors.

Topics

Resources

Stars

Watchers

Forks

Contributors