I have a folder that is a sub-folder in another folder that no longer exists. There's nothing in it but it won't let me delete it. It not a problem, just annoying. Is there any way I can remove it? Win 10.
Deleting an orphan folder
Feb 03, 2021
Last reply: 5 years ago
15 Replies
Twiddle the folder settings to show any hidden files..
If you have or are willing to install the free, open source 7-zip:
run 7-zip browse to the folder and right click Delete
If that fails try Move to a different folder, then Delete
chkdsk /f
Just what "no longer exists"?
It appears as an icon and name when using Explorer, but when I click on it, it says 'this folder is empty'. Then when I try to delete it, a text-box used to pop up saying the folder is within another folder (that no longer exists) and is unobtainable, but that doesn't happen now. It just sits there. Bringing up the properties, says it's a system folder.
That's the answer, then. A system folder.
Probably best forgotten about !
PA
Excellent. Converted it to something that I was able to delete. Thanks
NP. It shouldn't happen though, orphaned files/folders like that. Possible causes: power cut or powering off rather than shutting down; bad OS (unlikely); failing hard disk. If it happens repeatedly, start worrying.
No Windows utility sees everything. But we can try.
nfi.exe is in here (3,772,278 byte ZIP). In the nfi folder. nfi.exe is 21,744 bytes.
formatting link
In an Administrator Command Prompt window, run something like:
cd /d C:\users\chris\Downloads\ # presumed location of unpacked nfi.exe
nfi.exe c: > nfi_c_out.txt
It might be around 375MB of output file, to list a bloated C: partition.
Notepad is good to 500MB to 1GB or so now, and is better than it used to be.
The following chunk, is a directory. The $I30 marks it as a directory. If I had an "invisible" (Hidden) directory, then NFI can still list it. What the utility does, is read the Master File Table. You only need to be administrator, to read the MFT info.
Everything is a File. A File with a $I30 section, is a Folder. My sample folder here is fragmented (13 fragments).
File 81 \Users\chris\AppData\Local\Packages\Microsoft.Windows.Cortana_cw5n1h2txyewy\LocalState\AppIconCache\100 $STANDARD_INFORMATION (resident) $FILE_NAME (resident) $OBJECT_ID (resident) $INDEX_ROOT $I30 (resident) $INDEX_ALLOCATION $I30 (nonresident) logical sectors 517640-517647 (0x7e608-0x7e60f) logical sectors 575224-575231 (0x8c6f8-0x8c6ff) logical sectors 2915648-2915655 (0x2c7d40-0x2c7d47) logical sectors 2980160-2980167 (0x2d7940-0x2d7947) logical sectors 3174032-3174039 (0x306e90-0x306e97) logical sectors 3340248-3340255 (0x32f7d8-0x32f7df) logical sectors 6047080-6047087 (0x5c4568-0x5c456f) logical sectors 9826656-9826663 (0x95f160-0x95f167) logical sectors 20062256-20062271 (0x1322030-0x132203f) logical sectors 20062328-20062343 (0x1322078-0x1322087) logical sectors 31208864-31208895 (0x1dc35a0-0x1dc35bf) logical sectors 32106792-32106823 (0x1e9e928-0x1e9e947) logical sectors 47936512-47936543 (0x2db7400-0x2db741f) $BITMAP $I30 (resident)
To list the attributes (hidden, system, archive), you need to use "fsutil", a system utility. Here, I'm checking the attributes of some Windows 10 logfile.
fsutil usn readdata C:\Windows\Logs\CBS\CBS.log
A hex number comes back. For example 0x6 = 0x4 + 0x2 = System and Hidden The values are ORed together and stored in the USN.
FILE_ATTRIBUTE_READONLY = 1 (0x1) FILE_ATTRIBUTE_HIDDEN = 2 (0x2) FILE_ATTRIBUTE_SYSTEM = 4 (0x4) FILE_ATTRIBUTE_DIRECTORY = 16 (0x10) FILE_ATTRIBUTE_ARCHIVE = 32 (0x20) FILE_ATTRIBUTE_NORMAL = 128 (0x80) FILE_ATTRIBUTE_TEMPORARY = 256 (0x100) FILE_ATTRIBUTE_SPARSE_FILE = 512 (0x200) FILE_ATTRIBUTE_REPARSE_POINT = 1024 (0x400) FILE_ATTRIBUTE_COMPRESSED = 2048 (0x800) FILE_ATTRIBUTE_OFFLINE = 4096 (0x1000) FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 8192 (0x2000) FILE_ATTRIBUTE_ENCRYPTED = 16384 (0x4000)
The MSDOS "attrib" command handles just a few of those values. Some of the items in the above table, did not exist when "attrib.exe" was written.
attrib /?
Files and folders have permissions and ownership. Even though a person is Administrator, they can't delete TrustedInstaller files.
Everything in Windows is a "two-step". The obvious "let me hammer this for you" method, never works. Whereas "hold it up to the light and then let me hammer it", works. I certainly don't have the patience for a lot of this stuff. Too much bowing and curtsying. Maybe you need to do a "TakeOwn", before you can delete it.
There is UnLocker, from France.
There is PendMoves from
formatting link
(a Microsoft company). It stages items in such a way, that the spinning balls at shutdown give an opportunity to dispose of stuff. Still a bit of wishful thinking.
Robocopy, using the /MIR option, can be used to "overwrite an empty object on top of a pesky object". You could try running this from an Administrator command prompt. Robocopy is shipped in the Windows OS as a utility. Only in WinXP do you need to download XP026 version of this if you want to use it.
robocopy /? # a zillion options, spend a bit of time looking at them.
robocopy C:\emptydir C:\peskydir /MIR # you can MIRROR an empty object on # top of a full object, to flush the content
Now, I just use my USB key with Linux Mint on it. It's good for a variety of materials, but for C:\Windows items, you're in for a fight. Windows 10 uses "new style" compression, implemented as a Reparse Point, and Linux does not know how to parse those. Items in System32 might be compressed. Reparse Points are "custom NTFS features", which means Microsoft can easily stay one step ahead of the Linux crowd. Even though NTFS has a "standards version of 3.1", Reparse Points are effectively outside the spec and thus, a wildcard. This is only an issue for someone wishing to bypass Microsofts stranglehold on the filesystem.
I would start by verifying the "missing object" really exists, and it's just the "Hidden" attribute is applied to it. We don't want to be starting conspiracy theories that the file system can "lose stuff". Windows 10 has a background CHKDSK scanner, which is supposed to prevent data at rest from accumulating faults. This is why when you want to use CHKDSk on Windows 10, it will say "we didn't see a problem here, but you can scan if you want". But because you can't find a detailed description of exactly what they're doing, such reassurances tend to ring hollow.
File Explorer has View Options which include making Hidden items visible. I turn that on, so I can see AppData in my homedir. If you need a Hidden item to play with, you could try the AppData one. See if you can find AppData in the output of NFI :-)
Paul
I must try to bookmark that mentally. CHKDSK was once one of my regular tools, but I don't think I have used it for 20 years.
And how long since "debug g=c800:5" ?
<big snip of detailed instructions>
Thanks for all that, Paul. It doesn't look as though I need it now, but I'll keep it in mind for future reference.
Blimey, I remember using Debug to get to the low-level format routine but not the address!
Reminds me of MFM/RLL disks where the BIOS had to be aware of the number of cylinders, heads and sectors. The BIOS had room for about 40 different combinations and, while there were some standard ones, when new disks came out it was sometimes necessary to use an EPROM burner to create a new BIOS with the correct parameters for that disk. Remembering, of course, to alter two of the entries, one giving the correct parameters and the other altered so the BIOS checksum stayed the same.
And having to type in a list of (sometimes hundreds of) bad sectors from a printed sheet provided by the manufacturer during their own testing.
And Novell having their own test routine <Googles> Compsurf that could take days on a large disk.
Kids of today etc.
The usual problem is that there are hidden files and folders selected and when you do this you can also elect not to have the hidden state on sub folders, which in effect means since you cannot see the hidden folder, you cannot delete the unhidden sub folder as there could be other hidden folders off of it also. I nearly always say to peeps always show all folders when you set windows up. Unless you are really cack handed its unlikely you will be deleting system files and folders and it makes a folder which is not hidden with folders above and below it hidden far easier to delete. Of course if none of this is true when you reveal all files and folders then you may need to resort to first doing a disc check to see if there is corruption in the folders ie the fat tables etc, and correct them with a restart after selecting the test you need.
If even that fails then its specialist program territory, but be really careful as it could be some severe problem that you cannot see, particularly with SSDs. I would make sure you have backed up the machine recently before trying any tools like the ones I see on majoor geeks etc. Brian
Be careful there can be special folders in the folder that are hidden. Brian
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required