Monday, June 14, 2010

Windows XP Error Deleting / Moving File or Folder: Access is Denied = SOLUTION !

All images in this post can be enlarged by clicking on them!

Have you ever had windows provide an error to you saying you cannot move or delete a file or entire folder because you do not have access to it?
Well I spent a good few minutes troubleshooting this the other night. After about an hour I finally worked out why my Windows XP Professional was not allowing me to delete 5GB of data files off my external hard disk drive. This is the error message in question:
"Error Deleting File or Folder

Cannot delete f0045528: Access is denied.

Make sure the disk is not full or write-protected and that the file is not currently in use."




To solve this issue so you can delete the folder you do have to do two actions:

1) Disable simple file sharing if it is enabled - Depends on your OS - (Windows XP Pro)

2) Take ownership of the folder (or files within the folder) in order to be able to have permissions to delete them or move them.
Step 1 (Windows XP Home users)


Windows XP Home users will need to start windows in safe mode (press your F8 key continuously at start up until you are provided with a black screen and a load of white text options. Select 'Start Windows in Safe Mode'. Then navigate to the folder / files you wish to delete or move.

Step 1 (Windows XP Pro users)

Visit the following link on how to do this:

http://support.microsoft.com/kb/307874/
Then navigate to the folder / files you wish to delete or move.

Step 2 Take Ownership and set permissions
In my example I had a folder which I wanted to delete. Yet it was the actual files inside the folder which needed the permissions and ownership changing.

Instead of spending ages changing the ownership and permissions for one single file at a time I selected all files in the folder I wanted to delete (using Crtl + A); then gave each file within the folder the same ownership and permissions enabling me to delete the entire folder.

First though before you continue to delete (or move) your files / an entire folder. Make sure you are logged in as an administrator otherwise you won't be able to change the files ownership or permissions.

1) After selecting all the files in this example, you need to right click and select properties as shown:


2) On the 'Security' Tab of the properties window; click on 'Advanced' (1)

3) On the 'Advanced Security Settings' window, select the 'Owner' tab (2). Notice in my example that the owner is completely different to the currently logged on user (PeterLT). So in order to set permissions (you may have noticed they were greyed out on the main security tab); we need to confirm who owns the files.

4) In my example I select 'Administrators' (3) and then click 'Apply' (4) in order to make the files owned by all administrators; so all admin accounts will be classed as the owner of the files.

5) Now click on 'OK' and you'll find that the permissions are still greyed out, even though we have changed the owner of the files:

6) So click on 'OK' on the properties window to close it and save the ownership changes. Then select all files again and right click, selecting properties (short cut way is to simply press 'r' when the right click menu appears on screen). Now we can change the permissions:

7) On the 'Security' tab, select 'Everyone' so that it is highlighted grey. Then in the permissions window below tick the checkbox 'Allow' to the right of 'Full Control' - all boxes below will become ticked also. Then click on 'Apply' to confirm the change in permissions:

8) Now you can delete (in this case) the entire folder as all files have been successfully changed to allow such an action on the account you are logged in with:

That's it. All you need to do. Same goes for moving files as well. It is more than likely either (a) a file / folder permission problem or (b) an ownership problem.

Hope you found this helpful. Resources used as help for myself:

http://support.microsoft.com/kb/308421