SuperDelete: remove files with paths that are too long on Windows
Microsoft's Windows operating system has had a 260 character limit for paths for a long time. While most users may not run into issues with folder names and file names that exceed the limit, some may. If a path is too long, for instance when a USB Flash Drive is connected to the system that was used on a Linux distribution before, Windows won't run operations such as remove or edit on files if the path is exceeded.
Microsoft did add a new option to Windows 10 and Windows Server 2016 to enable NTFS Long Path in the Group Policy, it only works for "manifested" programs.
Third-party developers created programs to address the issue. There is Too Long Paths Detector which highlights paths that are too long on a Windows machine, or Long Path Fixer to run move, copy or delete operations on files or folders that exceed the path limit. There is also a manual option, as you may reduce the path by changing file and folder names to drop below the 260 character limit.
SuperDelete is a command line tool that has been designed specifically to delete files and folders that cannot be deleted in Explorer because the path exceeds the character limit.
A Windows command-line tool that can be used to delete files and folders with very long paths (longer than MAX_PATH 260 characters). It supports paths as long as 32767 characters. It works by using extended-length paths and the Unicode versions of the WinApi functions for enumerating and deleting files. In addition, it supports bypassing ACL checks for deleting folders if the user has administrative rights on the drive.
Usage is pretty simple: download and extract the program to the local Windows machine, or put it on a USB Flash Drive or tools collection disc. Run superdelete.exe fileOrFolderPath to run the delete operation with confirmation.
The program lists the path and file name, and prompts you to accept (y) or decline (n) the request.
The application supports three parameters that you may add to the command:
- --silent runs the command without confirmation.
- --bypassAcl bypasses the ACL check if you have elevated rights on the drive.
- --printStackTrace helps with debugging. It prints the callstack where an exception occurs.
Is it the 8.3 filepath that cannot be more than 260 chars or the long filepath?
“It supports paths as long as 32767 characters.”
.. I don’t know
……. doesn’t seem quite long enough
Automatically generated backups from my syncing routines occasionally surpass Windows’ filepath limit, which is a hassle when I’m cleaning out my backups folder. This utility looks to be a lot easier than the clumsy workarounds I previously used, so thanks for pointing it out, Martin.
It would be nice to have a program that could:
1- Scan a disk or a folder (recursively, of course) and output a .txt list of too long paths detected. (Yes, I know Too Long Paths Detector does that, sort of); but mostly
2- Use such a list as input (instead of having to issue a command for each item in the list).
I think You can, at least in Windows 10 (maybe 7 and 8.1 to), bypass the limit by some reghacks. I think i have a regfile or a commandline (bat) somewhere that fixes that. But still, there will be a limit.
Martin, do You know about that ?
Do you mean this? https://www.ghacks.net/2016/05/27/microsoft-260-long-path-limit/
I just use the dos name in those instances, no special tool required
what dos name??? can you explain???
Use GS RichCopy 360 and change the directory location with smaller directory names – that way you’ll be able to fix this problem. Most other tools that you work with cannot copy files with long path names.
i think its also based on bit. 64 or 32 bit you are using>>>
You should try using the LongPathTool also. It is a very useful tool and easy to use. It worked perfectly for me.