3 ms·
I've experienced issues on Windows before where a path has been too long to remove. Renaming the long directory names to something short can get around it.
by martin-adams 11y ago
I've experienced issues on Windows before where a path has been too long to remove. Renaming the long directory names to something short can get around it.
- dietrichepp 11y agoTry creating a file like `nul.txt` sometime. http://superuser.com/questions/282194/how-do-i-remove-a-file-named-nul-on-windows http://superuser.com/questions/282194/how-do-i-remove-a-file...
- nacnud 11y agoMy favourite filename trick on Windows is to create a file called "1", then rename it using Windows Explorer using Alt-255 to create a blank character (not a space, but looks like a space).
- martin-adams 11y agoThat reminds me of creating a directory called * with root permission in the root file system on linux then asking the intern to remove it. sudo rm -rf * They'll learn the hard way to use double quotes around the directory name.
- neckro23 11y agoThe dumb-trick way to solve this is to use Robocopy with /PURGE to merge an empty directory with a parent of your non-deletable files. Somehow it manages to helpfully delete all the "extra" files.
- Kristine1975 11y agoIn my experience Cygwin (the Unix environment for Windows) also works. It's only the Windows explorer and the command line that has problems with long paths, not the file system/kernel itself.
- StapleHorse 11y agoAnother ugly trick is to create a junction (mklink /j) to some inner dir and then renaming the file or dirs making the path too long.
- i336_ 11y agoOn a related note, I once tried to access a long path in an ext4 filesystem on one of my USB HDDs using ext2fs on Win32. I hit the path-length limit and couldn't reach the final directory. So, I shared the directory I could reach, then browsed to the \\share. It worked. :D