Saturday, October 20, 2018

Deleting long directory names or deep nested folders

Eclipse created a temp folder in one of the directories which is nested quite deep, e.g.

dir1\dir1\dir1\dir1\...
I am unable to delete this folder in Windows via Explorer, the del or rmdir commands, nor the Cygwin 'rm' command. How should I remove this very long folder?

It just keeps saying "File name too long..."





If you are like me and don't like to install additional software to fix a problem like this, I'd go with XQYZ's suggestion and use robocopy to solve the problem. (In my case the problem was created by robocopy in the first place, by copying a directory which had recursive junction points in it without supplying /XJ to robocopy).

To delete the directory tree starting at c:\subdir\more\offending_dir:

The total step-by-step-process is as simple as this:

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.
source:

https://superuser.com/questions/256105/how-do-i-delete-a-folder-which-is-nested-quite-deep-and-avoid-file-name-too-lon

6 comments:

  1. Expecting and encountering an error in Blockchain is a normal thing. Users come across errors like 2fa issues, login issues, signup issues hacking issues and much more. User’s priority should be to eradicate all such errors in the least possible time. If you have no tricks to fix the errors, you can take one from the team of executives who are approachable at every point of an hour. You can dial Blockchain Customer support number +1-833-228-1682 and take complete guidance from the executives quickly.
    For more info: https://www.cryptophonesupport.com/wallet/blockchain/

    ReplyDelete
  2. Each site that is submitted to an online professional listing is put in a particular classification. Free business directory

    ReplyDelete
  3. Or then again you could search for a web-based professional reference that is specialty explicit, https://onohosting.com/

    ReplyDelete
  4. Thank you for providing such an important resource. I was looking for this guide when I came across this, which I thought was interesting enough to share. So now I'm going to share it and implement their suggestions. This essay's topic is How To Click Faster In Minecraft?. Playing games is a lot of fun. When you enjoy something while learning, your brain learns much more quickly than it should.

    ReplyDelete
  5. Thank you for consistently delivering quality content.It's online auto clicker a must-have tool for anyone dealing with repetitive clicking tasks.

    ReplyDelete
  6. This blog post made my day! Factors like mouse sensitivity and comfort can influence your
    CPSTest online performance.

    ReplyDelete