Donate SIGN UP

Deleting deeply nested files

Avatar Image
realaleman | 17:17 Fri 08th Aug 2008 | Computers
9 Answers
While using a new backup program I managed to put about 20Gb of files on my external HD that was not quite what I wanted and decided to delete them to make room for the right backup folder. Trouble is, there are some files that are so deeply nested that Windows can’t delete because the file name is too long (about 24 levels deep) Is there any way of deleting all these folders and the files within?
Gravatar

Answers

1 to 9 of 9rss feed

Best Answer

No best answer has yet been selected by realaleman. Once a best answer has been selected, it will be shown here.

For more on marking an answer as the "Best Answer", please visit our FAQ.
Just delete the top level folder and it will automatially delete everything under it.

Locate the top level folder in My Computer or Windows Explorer.

Select on the folder with left mouse button so it is selected.

Hold down the SHIFT key (this saves sending it to the recycle bin)

Then RIGHT click on the folder and from the menu select Delete.

The folder and all files / folders underneath will be deleted.

(The fact the files are on your external hard drive means that they probably would not have gone to the recycle bin anyway, but the use of the Shift key is useful if you want to ensure files are deleted right away rather than going to the recylce bin)
-- answer removed --
Question Author
Sorry vehelpfulguy, I used that method to delete all the rest of the files (it took ages) but the last few files are so deep in the directory that windows says the filename is too long. And I can't move them either, of course. I really don'r know how the backup program managed to write them in the first place. I've a nasty suspicion I'll have to reformat the whole darn partition.
How about going into Windows explorer, navigating down to the file or files concerned and try to delete from there.

If that does not work try rename the file so the name is shorter and then deleting it.

Or maybe move the file from its nested directory into a newer folder higher up the chain, maybe into My Documents, where it will have a shorter name.
Question Author
I've just discovered a microsoft site that tells me that Windows XP has a maximum path length of 255 chars, but with unicode it can be up to about 32,000! Apparently " To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\<very long path>". " . So how do I get to the DOS commandline so I can maybe do something?
Question Author
Just discovered the command prompt in Accessories and used the command rmdir g:\foldername/s and it disappeared with just one prompt of yes or no. I was expecting it to keep going until it hit the folder with files in and then stop, but my CLI training was on unix and that was years ago, so maybe I've forgotten how rmdir works. How do I check if everythins gone when no folder shows in the root of drive G?
How do I check if everythins gone when no folder shows in the root of drive G?

Its gone if no folder shows in the root.
Question Author
Many thanks to both vehelpfulguy and chuck for your help. Chuck has reassured me that I've actually acheived something and vhg showed me to delete withoy using the recycle bin...very useful.
Thanks again

Geoff.
Long Path Tool will let you easily delete, copy or rename long path files.

1 to 9 of 9rss feed

Do you know the answer?

Deleting deeply nested files

Answer Question >>

Related Questions

Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.