Solved

cannot reset file permissions on two folders

Posted on 2014-12-12
10
141 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The default behavior of the User Account Control (UAC) dialog is to disable (gray-out) the rest of the desktop when prompting for elevation. This is known as secure desktop. There are reasons that you may want to disable this secure desktop behavior…
OfficeMate Freezes on login or does not load after login credentials are input.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

863 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

29 Experts available now in Live!

Get 1:1 Help Now