# How to remove a Windows folder with error “Access is Denied”

I'm running Windows 2003. I am an admin on this particular machine. I tried to delete a folder, but something went slightly wrong. When I navigate to its parent I can see it in there.

When I double click the folder, I get the error message: D:\Path\to\folder is not accessible. Access is denied.

When I try to delete the folder, I get Cannot delete foldername: Access is denied. Make sure the disk is not full or write-protected and that the file is not currently in use. and I get the same when I try to rename it or create a similarly-names folder.

There is ample room left on that drive, so the disk isn't full at all.

Is there anything else I haven't thought of? I don't really want to restart the machine, but I will if I have to.

## migrated from serverfault.comAug 17 '11 at 17:05

This question came from our site for system and network administrators.

• Access denied means access denied. It's there and you are not allowed to delete it. No problem. – mailq Aug 17 '11 at 16:27
• I have seen some weird behavior when you have filesystem corruption. You may want to run a check disk, but if that is on your system drive, you would need to reboot to do that. – Zoredache Aug 17 '11 at 16:35
• @maliq Actually, there are a lot of possible errors that get crammed into the Win32 "Access Denied" error. See for example support.microsoft.com/kb/113996 There are 25 references to "ACCESS_DENIED". This could easily be STATUS_CANNOT_DELETE which doesn't say the say what the issue is. – Chris Smith Aug 17 '11 at 17:36

## 3 Answers

Use process explorer http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx to find out what has the file in use - there is some process that has a lock on it and explorer does not tell you which one.

1. Launch Process Explorer
2. In Process Explorer select the Find \ Find Handle or DLL menu or press Control+F
3. Search for the folder full path in question (example d:\Common\Cost)
• Using the search in process explorer against a folder name that we couldn't delete found that one user happened to be sitting in it. Informed the user, found the PID, killed the process in task manager, and done. Folder was released. This worked for me! – JoshDM Dec 11 '13 at 21:22

You may need to take ownership of the folder and its contents then reset the security before you can delete it.

• I can't take ownership (or at least I don't know how). The only tab available in Properties is General – Piers Karsenbarg Aug 18 '11 at 8:34
• You might have to login with the actual administrator user, not just a user with admin rights. – ErnieTheGeek Aug 18 '11 at 13:11

It turns out that getting rid of this pesky problem is a two-stage process:

• 1st - as many here already suggested - Take Ownership of the foder and make sure you check all subfolders and files.

• 2nd - and this is outright retarded - you need to grant yourself Full Control - again, make sure you check all subfolders and files.