We had a robocopy script go out of control and duplicate infinite sub-directories. We could not delete them via Windows because the filename was too long for Windows to handle. Fortunately robocopy is able to help us with this.
To delete the directory tree starting at c:\subdir\more\offending_dir:
- cd c:\subdir\more to cd into its parent directory.
- mkdir empty to create an empty directory.
- robocopy empty offending_dir /mir to mirror the empty directory into the offending one.
- After some waiting you’re done! Finish it up with: rmdir offending_dir to get rid of the now empty offending directory and rmdir empty to get rid of your intermediate empty directory.
The post How to delete a long path that Windows is unable to delete appeared first on 916 Networks.