MacLochlainns Weblog

Michael McLaughlin's Technical Blog

Site Admin

Delete an Access Denied File

with 7 comments

When my old Toshiba Tecra died because of a fried mother board, I salvaged my hard disk. I snagged a 2.5″ USB hard disk case but didn’t have time to clean it up. While cleaning up the old Windows XP files tonight, I ran into the following error:

E:\WINDOWS\Temp\hsperfdata_SYSTEM>attrib +R *.*
Access denied - E:\WINDOWS\Temp\hsperfdata_SYSTEM\2792

I thought the attrib utility might help me fix the error but it didn’t. I checked the file Property dialog for a quick fix and didn’t find one.

A little poking around on the web and I decided that disabling simple file sharing may provide additional options. You disable it by navigating to Start, My Computer, where you click on the Tools option in the menu and chose the Folder Options … to get the following dialog box. You clicked the View tab. In the tab, you scroll down in the Advanced setttings section until you see the Use simple file sharing (Recommened) option. You click the check box to turn off simple file sharing. Click the Apply button to make the change.


Open a separate Explorer session, and navigate to the directory where you’ve encountered a file that denies you access to delete it. Right click on the file. You should see two tabs, one labeled General and the other Security. If you see only the General tab, you may have forgot to check the Apply button earlier.


Click the Security tab to see the following dialog. Click the Allow check box in the Permissions for Everyone section and then click the Apply button. You should now be able to delete the file in Windows Explorer.

Written by maclochlainn

January 27th, 2009 at 12:21 am

Posted in Microsoft XP

7 Responses to 'Delete an Access Denied File'

Subscribe to comments with RSS or TrackBack to 'Delete an Access Denied File'.

  1. You are the solved it! I was able to delete that folder after that. Thanks a lot 🙂


    18 Mar 11 at 11:05 am

  2. Thank you for sharing this wonderful tip. It worked.


    11 Jan 12 at 4:57 am

  3. Didn’t work for me. Still refuses to delete the file. Getting a bit frustrated

    Steve H

    3 Apr 12 at 12:01 am

  4. Are you the Administrator when attempting the file deletion? If not, you must be when the file is owned by the Administrator, which is Windows equivalent to Linux’s root user.


    3 Apr 12 at 9:23 pm

  5. That was just what I needed…… smart post!

    Sam Mohamed

    13 Feb 13 at 10:49 am

  6. Use this as an alternative “LongPathTool” an easy fix for your problem (not an endorsement of the referenced product).


    13 Jul 13 at 5:26 pm

  7. Finally this worked for me to delete an old windows7 folder in a fresh windows xp install. Unlocker and dos commands didn’t work, but simply disabling simple filesharing and having the security tab worked like a charm! Thanks!


    23 Jan 14 at 2:09 pm

Leave a Reply