Solved: cannot delete folder - access denied

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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??
 
Joined
Oct 3, 2007
Messages
7,889
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>

.
 

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)
 
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.
 

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.
 
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 ;)
 
Joined
Oct 3, 2007
Messages
7,889
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.

.
 
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.
 
Joined
Aug 7, 2007
Messages
9,028
But, by taking ownership, it allows you to delete it :confused: At least it's always worked that way for me.
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.
 

Attachments

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
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Members online

Top