Cannot delete file: Access is denied

Posted April 12, 2006 by Hack_Vista in Windows

How many times have you seen this error? If I want to delete a file, I WANT TO DELETE THE FILE! At least windows should tell you, who is locking the file, right? Here are some helpful hints to get you around this common windows problem.

You’ve seen these errors. So painful.

Make sure the disk is not full or write-protected and that the file is not currently in use.
Cannot delete file: Access is denied.
The file is in use by another program or user.
There has been a sharing violation.
The source or destination file may be in use.

First I would suggest trying to find out why the file is locked. If it is spyware or a critical process, you may want to know that such a problem exists. WhoLockMe will allow you to right-click any file and see what program is locking the file. A more powerful version of this is actually unlocker than will allow you to kill the processes that are locking file file and delete them automatically.

If you want to try to avoid installing more software, you can try these helpful hints in the prior recipe:
Access Denied — How to Delete Protected or Spyware Files. By using these techniques, many times you’ll be able to close the locking program and continue with your day without downloading additional software.

How to delete locked files is one of the most requested problems at my PC shop. Maybe, this will keep me off the phone!

The Conversation

Follow the reactions below and share your own thoughts.

  • icanhelp

    Most times when this this happens the first thing i try to do is rename the file. I usually get an access is denied error for that as well, but if the file has subfolders try renaming those too. This usually doesn’t work but it does for some files.

    • Mehrotra001

      Can U guide to locate locking handle of ‘access denied’ files, USBs etc?
      Please respond by mail at ,+ 91 9979874999


        > > login as administrator
        rt click on the folder
        select properties
        select securety
        select full fontrol
        select ok
        then try to delete the folder
        100% folder is deleted

        sanjay raut


      > # Right-click the folder that you want to take ownership of, and then click Properties.
      # Click the Security tab, and then click OK on the Security message, if one appears.
      # Click full control check box and then click ok .
      # know try to delete the folder

      If you want to take ownership of the contents of that folder, click to select the Replace owner on subcontainers and objects check box.
      # Click OK.

      You may receive the following error message, where Folder is the name of the folder that you want to take ownership of:
      You do not have permission to read the contents of directory Folder. Do you want to replace the directory permissions with permissions granting you Full Control? All permissions will be replaced if you press Yes.
      # Click Yes.
      # Click OK, and then reapply the permissions and security settings that you want for the folder and the folder contents.

  • Anon

    far too many ads on this page, it actually put you off wanting to read it!

  • shashi

    thanks the wholockme program helped me a lot….!!

  • Anonymous

    If you cannot delete a file or directors, probably it might be corrupted. In such cases no tools will work. Just apply the Command C:/chkdsk/f from windows command prompt. this turn the corrupted file and directory to normal status and you can delete the file easily as you do usually.

    sknyer – the superwiz tech –

  • Sharon

    thanks for giving a straight answer and not sending me to a “you need a registry scan site” we know the purpose of those sites, to earn commissions.

    your site is very helpful and valuable. i am bookmarking it.

    i’ll be back…

    hasta la vista, baby

  • Anonymous

    How do you delete a file or folder where you get an error message beginning “(file or folder name) refers to a location that is unavailable”? I’ve got a whole lot of files where I get this message. I can’t rename them, delete them, move them or change the file extensions on them. Unlocker or delete-on-reboot don’t work on them. Advice, please. Thanks. Ian

  • pissedoff

    went to the unlocker link above..guess what came up…PERMISSION IS DENIED..LOL..thanks alot for nothing

  • pissedoff

    went to the unlocker link above..guess what came up…PERMISSION IS DENIED..LOL..thanks alot for nothing

  • Anonymous

    Some files are inside Windows users folder and have stronger security settings. This happens more often with Illustrator files and folders having at one point highter settings. Unlocking these files, trying to delete them using the command propmt or even using administrative access does not work. You can often avoid this if you keep these type of files outside of the Windows user folder.

    Solution: You can still delete them if you change your user setting “Turn User Account Control Off.” After deleting you can reset the secruity setting.

    • Anonymous

      Just go to drive, where you folder of file is contained . right click to open security . Select the user with which you have loged in and under assign full control.
      this will work if you have permission of assigning access rights.

    • thank

  • Hi,
    I just had this ditto issue with 3 real player files, they are finally gone.
    This is what I did.
    1) Uninstall the programme ,re-install it later if you choose to.
    2) create a folder
    3) delete the folder instead of individual files together

    Well It worked for me…

  • nazim

    icanhelp – thanks a lot. i had an .flv file which was simply refusing to go away. i changed the .flv to .txt; after that i changed the name of the file itself. then i hit the delete key. it went away… phew!

    • Xxxeni

      WhoLockMe.exe (from Paris, France) has spyware/malware in it. It is nasty to advertise it as the least. Should be criminal.

      • Xxxeni

        Do you know what governments do to spies? They prosecute them – prison terms or a death penalty. Yet those who load spyware, malware etc. into person computers are ignored, is this legal? Spyware loading into any computer should be made criminal!

    • nazim- THANK YOU. I spent the last 1/2 hr trying all kinds of fixes and only yours worked.

  • Shgs03

    My operation system is Windows xp2. I log off guest. then i want to delete file for D driver. But can not delete file. Because access is denied. Why? Help me?

  • Ajayrajawat009

    i want to normal user can not delete created file in lan network.on windows xp and server2003

  • Sader

    Its very easy and simple…just rename the file and make it .txt extensions and then tru to delete it, it will work right away..Ali


    safe mode with command prompt rocks mothers to ”access denied files”



  • JoshuaReen

    I have used “Long Path Tool” software in this situation and it helped me easily and quickly.

  • Jose Bautista

    The process is too complicated,besides that I don’t want to know who got those files locked in; after I find out who got those files locked in,what will I do? it won’t help me, will “WhoLockMe”help me delete the files?
    if not,then what is the use to use this program? and the other program that will help delete those files
    “Unlocker” the link is broken” I don’t see any purpose on this little program,unless a help me to delete those files. The installation of the program is too complicated for nothing

  • anothersolution

    The extension renaming can work, but this is what I did: Opened the folder and deleted the files inside one by one, hoping to find the culprit. Nothing hung me up (I think it had something to do with the google chrome files inside), then was able to delete the folder once empty.

    This happened twice, once in a document folder on my desktop with photos inside, and once to delete the temporary user I made and deleted – had to do the same thing to get rid of the residual data files placed on my desktop.

  • Joel

    Hi. I can’t delete a file in the SCAN folder (automatic folder where scanned docs are saved) of my friends PC. I have tried using the DOS prompt with the explorer.exe closed. I have also tried the softwares that can be used to delete “access denied files” but failed. Please help. Thanks.

  • Xian Sembrano

    Do you have error messages?, like :
    Path too long
    Error cannot delete file: cannot read from source file or disk
    Cannot delete file: Access is denied
    There has been a sharing violation.
    Cannot delete file or folder The file name you specified is not valid or too
    long. Specify a different file name.
    The source or destination file may be in use.
    The file is in use by another program or user.
    Error Deleting File or Folder
    Make sure the disk is not full or write-protected and that the file is not
    currently in use.
    Error Copying File or Folder.
    Cannot remove folder.
    The filename or extension is too long.
    Path too deep.
    Destination Path Too Long.
    Could not find this item.
    Filename is not valid.
    The file could not be accessed.
    The path you entered, is too long. Enter a shorter path.
    File Name could not be found. Check the spelling of the filename, and verify
    that the file location is correct.

    If yes, our progam will be helpful for you. Fix filename too long, filename is
    too long, too long path and path too long problems forever.

    “Long Path Tool” ——search it from

  • alay

    i can’t select the full control check box how can i select i have already logged in as a administrator