Fix STATUS_DIRECTORY_NOT_EMPTY (0xc0000101) on Windows 10/11
Windows throws this when a folder isn't actually empty. The real fix is killing file handles or clearing hidden files. Skip the reboot.
Why you're stuck with 0xc0000101
This error means Windows thinks the directory still has files in it — even when Explorer shows it as empty. The culprit is almost always a hidden or system file you can't see, or a process that's holding a handle open inside that folder. I've seen this most often with temp folders left behind by Visual Studio, Adobe apps, or leftover antivirus quarantines.
First fix: Kill the process holding the handle
- Download Process Explorer from Microsoft Sysinternals. Don't waste time with normal Task Manager here.
- Run it as admin. Hit
Ctrl+F, type the folder name you're trying to delete. Wait — this can take a few seconds on large drives. - It'll show you the exact process (like
explorer.exe,OneDrive.exe, orSearchIndexer.exe) locking the folder. - Right-click that process → Close Handle. If it's
explorer.exe, you'll lose your taskbar for a moment — just restart it afterward. - Try deleting the folder again. 9 times out of 10, this is the fix.
Second fix: Use command line to force delete
If Process Explorer finds nothing, the folder probably contains hidden system files. Open Command Prompt as admin. Then run:
robocopy C:\empty C:\stuckfolder /MIR
rmdir /s /q C:\stuckfolder
First, create an empty folder on C: drive — call it empty. The /MIR flag mirrors that empty folder into your stuck one, wiping out everything inside including hidden files. Then rmdir cleans up what's left. This works because robocopy bypasses Explorer's nice-guy checks.
Third fix: Take ownership and clear attributes
Sometimes the folder is marked read-only or has corrupted ACLs. This command chain nukes that:
takeown /f C:\stuckfolder /r /d y
icacls C:\stuckfolder /grant administrators:F /t /q
attrib -r -s -h C:\stuckfolder\* /s /d
rmdir /s /q C:\stuckfolder
That grabs ownership, grants full control, strips read-only/system/hidden flags, then deletes. Takes about 10 seconds.
Why this error happens
Windows protects directories that appear non-empty to prevent accidental data loss. The OS checks the directory's file list at the NTFS level — not what Explorer shows. If even one file appears in the MFT (Master File Table) with any flag set, the delete fails. Common hidden files causing this: Thumbs.db, Desktop.ini, ~$temp Office temp files, or leftover AV quarantine entries.
Less common variations
- Junction points or symbolic links: If the folder contains a junction to another drive, Windows throws this error. Run
dir /a /s C:\stuckfolder— if you see<JUNCTION>entries, remove them first withrmdir(notdel). - OneDrive or Google Drive sync conflicts: These services lock folders they're syncing. Pause sync, kill the sync process, then delete.
- Long paths (>260 characters): Windows Explorer can't handle them. Use
robocopywith the/LONGflag or prepend\\?\to the path:rmdir /s /q \\?\C:\stuckfolder\ - Corrupted junction points: A ghost junction that points to a deleted target. Run
chkdsk /f C:to fix the NTFS index, then retry.
Prevention for next time
- Always check hidden files first. In Explorer, enable "Show hidden files, folders, and drives" and uncheck "Hide protected operating system files" before deleting.
- Close apps before deleting their temp folders. Adobe, Office, Visual Studio — they leave handles open.
- Use a dedicated cleanup tool. I swear by BleachBit (open source, portable) for bulk temp deletions. Never had it trigger 0xc0000101.
- Avoid deleting inside the OneDrive folder directly. Unlink OneDrive first via its settings, then delete.
That's it. You're not going to find a faster fix for 0xc0000101. Keep Process Explorer handy — it'll save you days of headache.
Was this solution helpful?