50

I have an external hard drive, changed some security settings of files, and now I am not able to access them in my other system. I am an admin in this system. Is there any tool that can reset all of the security settings of all contents to default?

4
  • Are the systems joined to a domain, home group, or workgroup? To be honest, based on the way your question is framed now, the permissions system is working as designed.
    – Colyn1337
    Oct 14, 2013 at 17:52
  • Assuming only files are affected, try copy the affected files to Desktop, then create a new folder in the external hard disk, then copy files from desktop to it. If folder is affected, create the folder one level above.
    – PatricK
    Oct 14, 2013 at 21:34
  • @Colyn1337: Yes, the system is working as designed, but OP wants do circumvent it. Thus the question (which seems reasonable to me).
    – sleske
    Sep 9, 2016 at 11:44
  • Similar question: Permissionless external drive with NTFS
    – sleske
    Sep 9, 2016 at 11:47

4 Answers 4

60

You can do this with the GUI -- take ownership and then reset everything --

Right click root folder > properties > security > advanced > owner (tab) > edit > choose your account from the list (or select from the Other Users or Groups button) and select "Replace Owner on subcontainers and objects"

Take ownership

There is also a "takeown" command, i.e. if the files are on a drive that you see as E: --

TAKEOWN /F E:\ /R /D Y

Once you have taken ownership, then you have to set the permissions; for this, you use ICACLS:

ICACLS "e:\" /reset /T

Alternative ways of changing the permissions with ICACLS can be found with "ICACLS /?" as you can explicitly add your permissions, replace, etc.

There is a nice tutorial with screenshots (including the one here) at http://www.askvg.com/guide-how-to-take-ownership-permission-of-a-file-or-folder-manually-in-windows/ although it shows you how to do the whole process from the GUI.

8
  • TAKEOWN should read TAKEOWN /F E: /R /D Y - can't edit as its < 6 chars - really SE?
    – Ryan
    Dec 15, 2013 at 12:24
  • 1
    Ryan - why the change? E:\ and E: are effectively the same; the first points to the drive, and the second to the root level of the drive. If you can explain, I will find a way to incorporate the edit. Other than that, you are correct; the "Y" is the prompt-response for the "/D" switch.
    – Debra
    Dec 16, 2013 at 13:29
  • 1
    Sorry yes, only need to remove / before Y
    – Ryan
    Dec 16, 2013 at 14:12
  • 2
    Your second command ICACLS "e:\" /reset /T is not working on my pc. Telling me This operation is not allowed as it would create an un-usable ACL. Dec 19, 2013 at 11:01
  • 8
    Instead of second command which is ICACLS "e:\" /reset /T, navigate to the desired directory using cd. Eg. cd /d E:. Once done run this command: ICACLS * /reset /T Feb 12, 2014 at 15:33
11
TAKEOWN /F E:\ /R /D Y

The command works fine.

ICACLS "E:\" /reset /T

The command did not work, but had to add an asterix (*) to it. As an example:

ICACLS "E:\*" /reset /T

For those who bumped in to the same problem as me.

2
  • This seems like a comment and might not stand on its own as an answer. Can you provide more details?
    – bwDraco
    Sep 21, 2015 at 21:17
  • Did you mean E:\* instead of `E:*`?
    – DavidPostill
    Sep 21, 2015 at 22:22
3

Debra gave the suggestion which worked very well for me... Many many thanks Debra! I wish I had the repo to vote up for your answer :)

Below is what my side of the story was and what I did to solve it..

My problem goes like this - I had Windows 7 Ultimate x86 installed on my dell studio earlier which developed some bad sectors over the years, and suddently the system started failing abruptly hence I replaced the hard disk with a new 500GB one and installed the same Windows 7 Ultimate x86 on the new one.

I did not take backup of my personal user files which I kept inside old documents or desktop as I thought using the Administrator account it could be done from the new HDD as we used to do in Windows XP.Well thats where I went wrong!!

WIndows 7 has some crancked up security inbuilt, which avoids any other guy to step inside your personal files just like that. Basically I couldn't access my old files when I connected the previous HDD. When I tried going into Users\Administrator or Users\MYUSER directory it just said - "Access is Denied" or went on showing the progress circle indicator for infitely long time and never actually opening it.

So I followed this amazing tutorial about how to change ownership and permissions in Windows 7 using GUI - http://www.blogsdna.com/2159/how-to-take-ownership-grant-permissions-to-access-files-folder-in-windows-7.htm

But it didn't work out for me as my permissions in old Windows also were pretty wasted. So I came to This article and it worked!

Following is what I did in (order of appearance) -

  1. Started my windows PC with the target hard disk connected that has the folder I want ownership to.
  2. Went to Control Panel.
  3. Opened Administrative Tools (it's under System & Security when viewing categories)
  4. Then clicked Computer Management (2nd from the top).
  5. Then open Local Users and Groups
  6. Inside that you will see two sub categorizations - Users, Groups. Open Users
  7. That should display 3+ Users. Top one will be Administrator. Right click it and select Properties
  8. Uncheck the "Account is Disabled" setting and then select ok.
  9. Then close all windows, and logoff / restart your windows.
  10. This time you should see a new user as the first one - Administrator, click it to login as Administrator to the computer.
  11. Now the real game begins.
  12. Click Start button and type cmd in the search box, when appeared right-click cmd and Run as Administrator (Elevated Command Prompt is what will get us there)
  13. Now go to My Computer and check the drive letter which is available as a mounted active partition in your windows, remember it's drive letter. e.g. 'F' (This is the partition which contains those Users directories which you want access to).
  14. Now go to command prompt we opened in step 11 and type that drive letter e.g. F: and press enter
  15. Then change directory to the parent directory of the folder you want full ownership to. e.g. If I want access to all files and directories inside "F:\Users\Administrator\" I would cd to F:\Users
  16. Now as mentioned by Debra run following commands -

F:\Users>TAKEOWN /F F:\Users\Administrator\ /R /D Y (all dirs under will be owned)

F:\Users>TAKEOWN /F F:\Users\Administrator* /R /D Y (any left over files will be owned too)

F:\Users>ICACLS "F:\Users\Administrator*" /reset /T

  1. One both the commands ran, I went to My Computer, opened the F: drive and successfully was able to browse inside the Users\Administrator directory and view, copy, cut or delete them to my destination.

Hope it saves your weekend!! NRJ

2
  • actually believe or not, once I moved to win 10, i have the same issue, and your answer is well timed, i'll sure to check that out and brings my feedback. thanks Aug 12, 2015 at 11:47
  • So, where's that feedback? :)
    – Jon
    May 22, 2016 at 15:51
2

There is a problem with the other answers here. They assume that the base of the drive has the correct permissions already. I reinstalled Windows 10 and my applications could not access the already-created files and folders on the external drive. For example, Origin (a game distribution service like Steam) could not download and install its programs to the "Program Files" folder that I have on the external drive.

In order to discover what the default settings for an external drive are, I reformatted a USB drive. The correct settings are: Everyone : Full control.

Set the base folder with those permissions and then let it apply them recursively to all the other folders. This will allow your programs to function correctly, but the permissions on the drive are insecure for sharing among different computers with different users on those computers. If you want them to be more accurate, you'll have to do some thinking and testing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .