1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: cannot delete folder - access denied

Discussion in 'Windows XP' started by hangdog, May 4, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. hangdog

    hangdog Thread Starter

    Joined:
    Jul 24, 2007
    Messages:
    48
    greetings!
    i have an external usb hard drive with a wierd folder that wont delete.
    has a long name like some type of temporary folder, containing a "i386" folder. (windows setup?)
    windows explorer check disk says all is ok. nod32 scan says clean. tried the command prompt command "rd /s/q "folder name".
    all are "access is denied"
    recomendations??
     
  2. Mumbodog

    Mumbodog

    Joined:
    Oct 3, 2007
    Messages:
    7,891
    It may have a "System" attribute

    Open a command prompt, type in the following command and hit enter, then try to delete it

    attrib -s -h <file path here>

    .
     
  3. hangdog

    hangdog Thread Starter

    Joined:
    Jul 24, 2007
    Messages:
    48
    access denied. (these folders are empty btw)
    the dumb i386 folder is locked

    (us dogs gotta stick together)
     
  4. Mumbodog

    Mumbodog

    Joined:
    Oct 3, 2007
    Messages:
    7,891
  5. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Sounds like a temp install folder, they get created on the drive with the most free space. Some installers do not give users full control permission, only read only.
    This usually works if you don't have a Linux CD handy:

    Granting yourself permission to view Access Denied Folders:

    From an account that is a Computer Administrator, navigate to the folder in Windows Explorer.
    Note: On XP Home, you'll need to reboot to safe mode to see the Security tab.
    On XP Pro, you must uncheck Use simple file sharing (Recommended) in Control Panel | Folder Options | View tab
    On Vista, it's listed as Use Sharing Wizard (Recommended)
    Right click the folder, click Properties
    Click the Security Tab
    For Vista
    • If there is a Continue button, click it.
      You may have to take ownership of the folder.
    • Otherwise, click the Edit... button
    If the Administrators (Must have the s -- the icon will have two heads, not one) group is not listed:

    1. Click the Add... button
    2. Click the Advanced... button
    3. Click the Find Now button
    4. Click on Administrators (Must have the s -- the icon will have two heads, not one)
    5. Click OK, then Click OK again
    6. This gives Read access.
    For Full Control, highlight Administrators, then click to place a check in the Full Control box in the Allow column

    You should now be able to double click the folder to access it and see what is inside, or delete it.

    Sometimes works better if you add your specific user account, rather than just the Administrators group.
     
  6. Bernardo

    Bernardo

    Joined:
    Jan 8, 2006
    Messages:
    4,221
  7. hangdog

    hangdog Thread Starter

    Joined:
    Jul 24, 2007
    Messages:
    48
    the Outcaste nailed it - i had to take ownership of the dumb folder. thank you fellow dog!
    here comes a donation.
    someone needs to post up a thorough primer on users/groups/permissions, cuz these are a definate p.i.t.a.
     
  8. Bernardo

    Bernardo

    Joined:
    Jan 8, 2006
    Messages:
    4,221
    The small download I posted with add that option (take possession) to the right click menu ;) Easier than jumping through all those other hoops ;)
     
  9. Mumbodog

    Mumbodog

    Joined:
    Oct 3, 2007
    Messages:
    7,891
    Bernardo, that only takes ownership of the file or folder, but does not change "permissions", this has to be done manually as outlined by The Outcast.

    .
     
  10. Bernardo

    Bernardo

    Joined:
    Jan 8, 2006
    Messages:
    4,221
    But, by taking ownership, it allows you to delete it :confused: At least it's always worked that way for me.
     
  11. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Most times that will work, but in some rare cases it won't.
    The Context Menu entry is actually three separate commands. It first opens a Command Prompt window using cmd.exe, then runs takeown.exe to take ownership of the item you click on, and if it's a folder, takes ownership of the files and subfolders as well.
    If that is successful (and only if it is successful), it then runs icacls.exe to grant the Administrators Group Full Control permission, also done recursively if it's a folder. If takeown.exe fails you don't want to run icacls.exe as it will likely fail as well, but in some rare cases takeown.exe may return an error even if it succeeded, so icacls.exe never runs, so the permissions never get applied.
    Plus, the way it is configured depends on the system PATH variable to be able to find cmd.exe, takeown.exe, and icacls.exe, if any of those can't be found, it will fail, but the user may have no indication that it didn't work. And the .exe extension is not specified on takeown or icacls, so malware could easily replace those commands with a batch/script file located in another folder found earlier on the path, and could trick a user into clicking OK on a UAC prompt that will run malware instead of the Take Ownership option they think they are running.

    I've attached a better version that specifies the complete path to the file using the Systemroot variable, and uses the full file name including the extension.
     

    Attached Files:

  12. Bernardo

    Bernardo

    Joined:
    Jan 8, 2006
    Messages:
    4,221
    (y) Excellent explanation :)
     
  13. Mumbodog

    Mumbodog

    Joined:
    Oct 3, 2007
    Messages:
    7,891
    Does this new version work for Vista or W7?

    Thanks.
     
  14. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    It's the same commands and switches so works for both, I use it on Vista and Win 7 both, including x64. Set mine so it only shows with a Shift+right click, so keep forgetting it's there.

    Saw Bernardo's link to the Vista takeown add in and forgot this was the XP Forum, so just to avoid confusion:
    This "Right click to take ownership" registry file won't work for XP
     
  15. Mumbodog

    Mumbodog

    Joined:
    Oct 3, 2007
    Messages:
    7,891
    How did you do that?

    Thanks.
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Solved cannot delete
  1. Michayla
    Replies:
    8
    Views:
    723
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/921125

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice