Home » Questions » Computers [ Ask a new question ]

How do I delete a folder that's in use?

How do I delete a folder that's in use?

Sometimes when I'm working in Windows I'll get this prompt when I try to delete a directory:

Asked by: Guest | Views: 194
Total answers/comments: 5
bert [Entry]

"This answer is old, but seems to still get traffic. As noted below, there is a built in tool in Windows now:

Start → All Programs → Accessories → System Tools → Resource Monitor (or Run resmon.exe)

You can get more info in the answers below this one. The rest of this answer is no longer as relevant.

Process Explorer from Sysinternals will let you search through the handles and DLLs. Search for the directory and find out which process is ""using"" the folder.

From there, you have the ability to either shut down that process, or just close that particular file handle. Be sure about what you're doing when working with the file handle directly, and make sure it's not being used by some important process."
bert [Entry]

Unlocker and WhoLockMe don't work on 64-bit Windows. I use LockHunter.
bert [Entry]

I've had that happen to. Sometimes I can resolve the issue by deleting the contents first, then the folder(empty).
I've had that happen to. Sometimes I can resolve the issue by deleting the contents first, then the folder(empty).
bert [Entry]

"The quickest and simplest approach is to use Handle, as mentioned by slolife, rather than using Process Explorer. They're both from Mark Russinovich @ Microsoft.

Don't be surprised to find that explorer.exe is the culprit, as I did today. Apparently there is an official way to restart explorer.exe, but I seem to be getting away with killing it and starting it back up again it in Task Manager."
bert [Entry]

"I use Handle from SysInternals (now Microsoft). You can type in part of the folder name to see which process has a handle on that folder and then kill the handle.

handle64.exe -nobanner ""<path>""

For example:

Like others have mentioned, killing the handle can cause serious problems."