1

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?

1

5 Answers 5

3

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.

1
  • 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, 2010 at 22:55
2

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
0

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.

0

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

1
  • Good thinking, but no. I do have a Security tab for other directories, just not that one.
    – EMP
    May 17, 2010 at 7:10
-2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .