Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Windows XP Pro x64 SP2. I have a directory on an NTFS drive that was created by a Maven build. A subsequent build attempted to delete this directory and failed. I now get the error "Access is denied" whenever I try to do anything with that directory: change to it, delete it, rename it. This happens both in Windows Explorer and from a command prompt. The properties dialog in Windows Explorer doesn't even contain the Security tab.

I created the directory, so I don't think this is truly a permissions issue. I've occasionally had this error happen in the past is well. I believe the error is misleading, but the question is: what is the real problem and how do I fix it?

share|improve this question
Similar issue i.e. possible solution here?… – glenneroo Jan 18 '11 at 13:41
up vote 3 down vote accepted

Another application (or the system) could have an open handle to that folder (or a file/folder it contains).

The easiest way to find these is the find handle function of Process Explorer.

share|improve this answer
Indeed. It turned out that explorer.exe itself had a handle open and when I closed that handle (in Process Explorer) the directory immediately disappeared (ie. I did not have to delete it again). – EMP May 17 '10 at 22:55

Sometimes no one has rights to delete something, except the System user. This is how to execute a command prompt as System user:

AT HH:MM /Interactive CMD.EXE /K

where HH:MM is 1 or 2 minutes in the future.

When the clock ticks, a prompt will open. Use that window to delete the file, or start Explorer.exe. You may also need to grant the system user access right to the file or folder by executing the following command:

cacls "filename" /T /G system:F
share|improve this answer

I've since experienced similar issues many times and the solution is usually to close all Windows Explorer windows. If that doesn't help then check in Process Explorer as per Richard's answer.

share|improve this answer

The fact that you don't have a "Security" tab might be because you're having "simple file sharing" enabled? Make sure that item is not checked in the folder options dialog:

alt text

share|improve this answer
Good thinking, but no. I do have a Security tab for other directories, just not that one. – EMP May 17 '10 at 7:10

If you have administrative rights on the computer, check the access rights to that directory (right click -> Security...). You may also check your permissions to the parent directory (you need write access tere, too).

If you don't have administrative rights, contact your administrator.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.