DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: How to delete a folder that Windows can't find?  (Read 12,278 times)

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
How to delete a folder that Windows can't find?
« on: October 06, 2020, 10:35 AM »
Somehow my Windows 10 ended up with a folder on C: that it "can't find" when I try to delete it. :o

IIRC I copied or FTP downloaded a folder with a very long name (let's call it "Z"), containing files with long file names. Now I can only rename the folders above Z, but not Z itself. I can't open Z either. Deleting Z or any parent folder fails.

Any ideas? :)
Thank you.

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: How to delete a folder that Windows can't find?
« Reply #1 on: October 06, 2020, 10:53 AM »
Stuff I've done in the past:
Shorten names from above until it comes into range.
Map a drive letter to something just above the problem folder to "shorten" its path when accessed through the mapped letter.

and if you just want to delete it:
RmDir \\.\C:\[parent folder path] /q /s

Had to use that one a few times to get rid of hacked FTP's with hidden folder trees, using space character named folders.

x16wda

  • what am I doing in this handbasket?
  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 888
    • Participated in NANY Challenge Once
Re: How to delete a folder that Windows can't find?
« Reply #2 on: October 06, 2020, 10:58 AM »
For a GUI, try Helge Klein SetACL Studio. It will delete anything. Product page here, no cost (used to be commercial).
vi vi vi - editor of the beast

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: How to delete a folder that Windows can't find?
« Reply #3 on: October 06, 2020, 11:09 AM »
Yeah, I had already unsuccessfully tried "Shorten names from above until it comes into range."

rmdir did the trick! More info: https://docs.microsoft.com/de-de/windows-server/administration/windows-commands/rmdir

Thanks to both of you!  :)
Thank you.

hpearce

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 139
Re: How to delete a folder that Windows can't find?
« Reply #4 on: October 06, 2020, 02:13 PM »
Make sure you verify it's existence and name in the detail panel as opposed to the tree
Windows 7 SP1 (TM) Home Premium 64-bit .. Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26 GHz / 2.27 GHz .. 4GB RAM .. NVIDIA GeForce 9800M GTS .. Gateway P-7805u FX

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: How to delete a folder that Windows can't find?
« Reply #5 on: October 06, 2020, 03:45 PM »
Make sure you verify it's existence and name in the detail panel as opposed to the tree
Does it happen that there's a difference between the two? I checked and it's really gone. :)
Thank you.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
Re: How to delete a folder that Windows can't find?
« Reply #6 on: October 07, 2020, 02:58 AM »
I know the issue is already resolved, but here's another potential suggestion for anyone else who may come across this thread in the future. When problems like this crop up on my PC, I just boot into a Linux Live USB (usually Linux Mint) and delete the files from there. :Thmbsup:

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: How to delete a folder that Windows can't find?
« Reply #7 on: October 07, 2020, 03:27 AM »
In these situations, and especially with the "filename too long" problems, another thing I always try is to use the 7-Zip GUI interface to see if I can get to the folder and delete it from within 7-Zip.  Sounds strange, but it works quite often.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: How to delete a folder that Windows can't find?
« Reply #8 on: October 07, 2020, 05:13 AM »
"How to delete a folder that Windows can't find?" -- sounds like a zen koan

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: How to delete a folder that Windows can't find?
« Reply #9 on: October 07, 2020, 10:30 AM »
I know the issue is already resolved, but here's another potential suggestion for anyone else who may come across this thread in the future. When problems like this crop up on my PC, I just boot into a Linux Live USB (usually Linux Mint) and delete the files from there. :Thmbsup:
That would take (me) more time though. 8) And is Linux able to handle NTFS?


In these situations, and especially with the "filename too long" problems, another thing I always try is to use the 7-Zip GUI interface to see if I can get to the folder and delete it from within 7-Zip.  Sounds strange, but it works quite often.
Wow, that's weird! But cool. :)


"How to delete a folder that Windows can't find?" -- sounds like a zen koan
Yeah, it's a special sentence for sure.  ;D
Thank you.

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: How to delete a folder that Windows can't find?
« Reply #10 on: October 07, 2020, 11:00 AM »
"How to delete a folder that Windows can't find?" -- sounds like a zen koan

It was for a lot of FTP admins back in the day. Pirates would search for an un or poorly secured FTP server, and the create a folder tree with a space as one of the folder names using a Linux client (which allowed it..). Warez shoppers could easily traverse the path from outside, but the FTP admin could not see the hidden - space named - folder on their server using the Windows Explorer shell … Until the used space on the drive started to draw attention to something being very (very...) wrong.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
Re: How to delete a folder that Windows can't find?
« Reply #11 on: October 07, 2020, 03:05 PM »
I know the issue is already resolved, but here's another potential suggestion for anyone else who may come across this thread in the future. When problems like this crop up on my PC, I just boot into a Linux Live USB (usually Linux Mint) and delete the files from there. :Thmbsup:
That would take (me) more time though. 8) And is Linux able to handle NTFS?

I just always have a thumb drive with Linux on it hanging around just in case my Windows install dies and I need to boot into an OS that will allow me to attempt repairs or at least back up files before wiping the OS drive to reinstall. So it's not much time for me at all.

And yes, Linux can handle NTFS.
« Last Edit: October 07, 2020, 08:48 PM by Deozaan »

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: How to delete a folder that Windows can't find?
« Reply #12 on: October 07, 2020, 07:41 PM »
Ah, good to know. :)
Thank you.

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: How to delete a folder that Windows can't find?
« Reply #13 on: November 09, 2020, 07:35 PM »
For a GUI, try Helge Klein SetACL Studio. It will delete anything. Product page here, no cost (used to be commercial).
I found two more folders that couldn't be deleted, but this time on external drives, not C: - this time, rmdir failed twice, but SetACL Studio got the job done. NICE! :)
Thank you.

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Re: How to delete a folder that Windows can't find?
« Reply #14 on: November 09, 2020, 09:57 PM »
For a GUI, try Helge Klein SetACL Studio. It will delete anything. Product page here, no cost (used to be commercial).

Last year I had one folder it couldn't delete, couldn't do anything with it.
Can't remember what happened in the end, think I gave up and reinstalled Windows or formatted the drive.
Most obstinate file/folder I've had in 40+ years of playing with computers 🤣
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: How to delete a folder that Windows can't find?
« Reply #15 on: November 10, 2020, 12:19 PM »
For a GUI, try Helge Klein SetACL Studio. It will delete anything. Product page here, no cost (used to be commercial).

Last year I had one folder it couldn't delete, couldn't do anything with it.
Can't remember what happened in the end, think I gave up and reinstalled Windows or formatted the drive.
Most obstinate file/folder I've had in 40+ years of playing with computers 🤣
Yeah... I also remember applying the just give up 'solution' in the past. I just ignored it, deep in its directory path. :D
Thank you.

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: How to delete a folder that Windows can't find?
« Reply #16 on: November 11, 2020, 02:52 PM »
For the non long path related shenanigans, the other two most likely gotchas are ownership and attributes. I just ran into the - blast-from-the-past - attribute thing a week or so ago. Had a file marked read only and system that wouldn't leave until I stripped off those attributes.

LarenVansort

  • Participant
  • Joined in 2020
  • *
  • Posts: 1
Re: How to delete a folder that Windows can't find?
« Reply #17 on: November 17, 2020, 08:09 PM »
Stuff I've done in the past:
Shorten names from above until it comes into range.
Map a drive letter to something just above the problem folder to "shorten" its path when accessed through the mapped letter.

and if you just want to delete it:
RmDir \\.\C:\[parent folder path] /q /s

Had to use that one a few times to get rid of hacked FTP's with hidden folder trees, using space character named folders.

Thank you very much for your help, I was looking for an answer for a week!

Original address: https://www.donationcoder.com/forum/index.php?topic=50549.0