Windows 7 And Folders Which Don’t Exist

I’ve had an annoying problem on one of my disks for some time now. It all started when I was trialling a newsgroup aggregator and it created some very deeply nested folder trees.

At first, when I tried to delete the top-level folder it appeared to be locked – that’s usually when the file or folder is effectively held open by another (badly written) application, which means that Windows can’t remove it. Some applications are so poorly written that files are not closed properly, and can appear to be held open even when they aren’t. When that happens, a free utility called UnLock IT comes in handy. It effectively forces the “open” file to close so that it can be deleted.

But this particular folder simply refused to be deleted even after running UnLock IT. Even after I had deleted as much of the nested stuff as possible by hand, Windows just ended up warning me that one of the sub-folders was no longer in the location specified – even though it was clearly showing up in Windows Explorer. I was stuck.

But then I discovered this function you can run from CMD.EXE:

RD/s h:\foldername\

The h: is the disk drive where the folder is located, and “\foldername\” is the full path to the folder you want to remove. It asks you to confirm Y/N, but it got rid of it immediately.

It’s funny how something can drive you nuts for months, and yet once you put your mind to it you can find the answer in a couple of minutes!

(Visited 11 times, 1 visits today)