Solved

cannot reset file permissions on two folders

Posted on 2014-12-12
10
139 Views
Last Modified: 2014-12-12
I am working on a clients PC and there are two folders that I cannot delete. I am logged in as the administrator and resetting the permissions still doesn't allow me to delete those two folders.
How do I forcibly take control of them so that I can delete them and all the files underneath those two folders?
0
Comment
Question by:johnny181
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 1

Expert Comment

by:Mohammed Asish
ID: 40496539
What error message do you get when you attempt to delete these folders?
0
 
LVL 13

Expert Comment

by:Gabriel Clifton
ID: 40496555
Can you make yourself the owner of the folders, then change permissions and finally delete?
0
 

Author Comment

by:johnny181
ID: 40496557
access denied on lots of the files underneath those two folders.
I've also tried Takeown /R /F C:\Temp and that didn't reset them
BTW, the two folders are in C:\Temp
0
 
LVL 13

Accepted Solution

by:
Gabriel Clifton earned 500 total points
ID: 40496590
OK, here is something to try.
1. Download PsExec.exe from http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx.
Boot into Safe Mode to ensure nothing is accessing the files in the folder.
Move PsExec to C:\Temp
Open a command prompt with Administrator Privileges and CD into C:\temp.
Run: psexec -s -i cmd.exe, this installs a temporary service which will open a command prompt under LOCAL SYSTEM account. The service will be automatically deleted after you exit from the psexec prompt.
Run: ATTRIB -R -S -H <folder>
Run: TAKEOWN /F <folder> /R /D Y, this will set the Administrators group as owner, it recurses all folders and files in the folder.
To give the Administrators group full control rights, run ICACLS <folder> /grant administrators:F /T, the /T indicates that this operation is performed on all matching files and directories below the directories specified.

This process may take a few logoff/logon or reboots to catch every file and folder.
0
 
LVL 23

Expert Comment

by:Eirman
ID: 40496732
Try this really excellent and free utility to remove the locks on chosen files and folders ...
http://www.emptyloop.com/unlocker/
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:johnny181
ID: 40496795
that did the trick !!
0
 
LVL 53

Expert Comment

by:McKnife
ID: 40496799
There are some reasons why this may happen:
-file System corruption/ACL corruption
-user does not know how to reset ACLs or does not execute the takeown command elevated
-the folder path is very very long or contains characters that are forbidden

So reset the ownership info using an elevated command line and then modify ACLs so that your own user shows up with full perms.
->if that still does not let you delete them, use some tool that overcomes some foldername limitations that explorer has: delinvfile. It might help you deleting it.
->if unsuccessful, do a chkdsk on your drive and retry
->if even that does not work, boot winPE (any setup disk would do) and there delete from the command line. If no setup disk is around, download the knoppix CD.

Will definitely work.
0
 
LVL 53

Expert Comment

by:McKnife
ID: 40496805
Ah, I see I came too late. Well, since the system account cannot do anything that the admin can't when it comes to ACLs, your error before must have been having not elevated. Next time simply rightclick cmd.exe and select run as administrator, before you use takeown.
0
 
LVL 13

Expert Comment

by:Gabriel Clifton
ID: 40496973
True usually admin can do this, but sometimes permissions can get severely messed up and system needs to do the command.
0
 
LVL 53

Expert Comment

by:McKnife
ID: 40497131
By definition, this may not be... Who cares :)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Firefox seemed to slow down recently and it occurred to me that I had many open tabs — ultimately, I would find out that three-quarters of them were Experts Exchange tabs! :) So I decided to go on a hunt for a tool that would capture the names an…
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now