Del2Long.bat -- Delete directory containing long paths
--- Freeware ---
[page last modified 1/9/2014]
Del2Long.bat deletes the contents of a directory that contains very long paths/filenames. Such names cannot be handled by Windows Explorer, or DOS command line tools like DEL or RD.
I wrote this after accidentally performing an xcopy under Win 7 where the source had junction points that created a cycle. After the xcopy locked up, I interrupted it and found myself with a directory full of ridiculously long paths that I couldn't delete.
The single argument to Del2Long is the name of the directory whose contents you wish to delete (enclose name in double quotes if it contains spaces). Note the directory itself won't be deleted, just its contents.
This can be slow; the .bat recursively processes directories, renaming elements to shorter names until the entire path is able to be removed.
del2long dir Deletes files and folders within specified directory and below. Includes system/hidden/read-only items. Specifically handles cases where filenames/paths have grown too long for the normal system tools to handle. Examples: del2long . delete all in current directory and below del2long d:\bad delete all in d:\bad and below
Click here to download del2long.bat
You are visitor 4574 Go to Home Page