Fix: Restore Default File Permissions After Taking Ownership of Everything

You were somewhere along the lines of “Hey, I own this system, so why not really show it who the boss is?” and “Admin? Pfft., I want to be Godmin.” when you just decided to select the Windows and/or Program Files and/or Program Files (x86) directory and take ownership of all its contents.

Take Ownership

After the process—which is quite long—ended, you were happy that you’re now Godmin, not a mere plebian “Admin”. You were happy, life was delightful, oxygen felt like gaseous nitrous oxide because of just how God damned happy you were.

But suddenly, then, you realized that a lot—and by that, I mean a lot—of programs stopped running the way they used to. Some would crash randomly, some wouldn’t save data as they were saving before, your internet networks’ passwords won’t save, etc..

Now, this is because for some applications to function properly in Windows, a particular set of read/write permissions are required to be assigned by Windows itself to particular entities of the operating system. And when you mess that up… Windows smash.

Here’s my guide to restoring everything back to normal (hopefully) without a boring “IT normie” System Restore.

Method 1: Using the simple command generating tool [Automatic]

Step 1: Download the tool required

You’re going to need a simple and little tool that makes and executes specific commands in the command prompt according to the options you select. 

You can download this tool from here.

After the download is complete, extract the .RAR file anywhere you like and you’ll now have the “RestorePermission.exe” application there.

Step 2: Run the tool

Run the “RestorePermission.exe” file you just extracted and you’ll see a window like this:

Restoring.png

Choose the folder you want to reset the file permissions of, and then let the default options be selected, which are “Reset files permissions”, “Apply for all sub directories”, and “Don’t follow links”. On top of that, also select “Reset hidden and system files” too, if it is not already selected for you in the default configuration.

You’ll now see that the options and folder that you select do nothing more than just make a command prompt command in the text box below the options. And when you press “GO”, it only runs those commands in a command prompt window.

If you still do not trust the tool, just type the same command into a Command Prompt window you have opened yourself and hit Enter. Then you won’t have to click on “GO” and lose your computer to a covert fraternity of talking monkey pirates as you’re probably paranoid about.

NOTE: If you’re wondering what the ‘icacls’ in the command is, it is a command-line utility that can be used to modify NTFS file system permissions in Windows Server 2003 SP2, Windows Server 2008, Windows Vista and Windows 7.

Step 3: Wait for the restoration

Let Windows do its thing, you’ll see lots of files permissions being changed and the Command Prompt’s rapid scrolling will making you feel like you’re the lord of all hackers — but chill, grab something to drink, and let it complete. You’ll know when it is done.

After it’s done, pat yourself on the back and smile, you’ve done it. Now, please don’t do the “Take ownership from futile machine” thing again. You don’t need to own your system, you need to own others’ systems. <insert fsociety GIF here later>

Method 2: Using commands [Manual]

Step 1: Open a command prompt window

You chose this step because you’re paranoid dude or the hax0r terminal loving dude, either one. Anyway, not much to explain here, open a command prompt window by pressing the Windows + R keys and typing “CMD” in the “Run” box. Hit Enter and you’ll have a command prompt window in front of you.

Step 2: HammerHacker time

First select the folder you need to restore the permissions of.

Then enter the commands below (the second one only after the first command has fully completed executing), replacing “FOLDERPATH” with the folder path of your folder (including the quotation marks and the asterisk): 

icacls "FOLDERPATH*" /T /L /Q /C /RESET
This magic spell restores the permissions for the folder specified
attrib /s -h -s "FOLDERPATH*"
This magic spell restores the hidden and system files' attributes to default
/T: Indicates that this operation is performed on all sub-directories under the directory entered

/L: Indicates that this operation is performed on a symbolic link itself versus its target

/Q: Indicates that success messages should be suppressed

/C: Indicates that this operation will continue on all file errors. Error messages will still be displayed

Example: If I am looking to restore the permissions for the “Windows” directory, I’ll use the following commands:

icacls "C:\Windows\*" /T /L /Q /C /RESET
attrib /s -h -s C:\Windows\

NOTE: If you’re wondering what the ‘icacls’ in the command is, it is a command-line utility that can be used to modify NTFS file system permissions in Windows Server 2003 SP2, Windows Server 2008, Windows Vista and Windows 7.

Step 3: Wait for the restoration

Let Windows do its thing, you’ll see lots of files permissions being changed and the Command Prompt’s rapid scrolling will making you feel like you’re the lord of all hackers — but chill, grab something to drink, and let it complete. You’ll know when it is done.

After it’s done, pat yourself on the back and smile, you’ve done it. Now, please don’t do the “Take ownership from futile machine” thing again. You don’t need to own your system, you need to own others’ systems. <insert fsociety GIF here later>

And yes, I was lazy, so copied and pasted the same 2 paragraphs I had written for the automatic method.

16 comments

  1. Hmm, can’t extract a RAR file. What happened to ZIP? So I launched my admin cmd and entered the icacls command just as you had it. Access denied error messages sent the display scrolling in a crazy demented way. I read the comments and saw you said to ignore and follow through to the end, so I waited. At the end, “Successfully processed 123111 files; Failed processing 166567 files”. No, the calculator still won’t launch. I had great hopes this would fix that problems. I guess I have to continue to live my life without a Win OS calculator. QQ Is there anyway to process those 166567 Access denied files? P.S. I like your style. It makes me laugh.

    Like

    1. Hey!

      1. Why couldn’t you extract the .RAR file? We’re curious to know
      2. Are you sure this was an administrator-executed Command Prompt? “Access denied” should not be an issue with an indeed elevated Command Prompt
      3. Are you sure you had the quotations and also the asterisk included within your icacls commands?

      Do let us know!

      Like

  2. Hi, Can you please help me, why do I get ‘Invalid parameter’ and ‘Parameter format not correct’ messages? Here is the copy of CMD:

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Windows\system32>H:

    H:>icacls H:\Applications* /T /L /Q /C /RESET
    Successfully processed 37 files; Failed processing 0 files

    H:>icacls H:\Games Archive* /T /L /Q /C /RESET
    Invalid parameter “Archive*”

    H:>attrib /s -h -s H:\System Volume Information\
    Parameter format not correct –

    H:>icacls H:\Games Archive\ /T /L /Q /C /RESET
    Invalid parameter “Archive\”

    H:>icacls H:\Games_Archive* /T /L /Q /C /RESET
    H:\Games_Archive*: The system cannot find the path specified.
    Successfully processed 0 files; Failed processing 1 files

    H:>

    Like

    1. Hey!

      We believe this might be due to the space in the directory name. As you may see, the message says:

      Invalid parameter “Archive*”
      … while the full directory name is “Games Archive”.

      In order to mitigate this, we use quotes to explicitly tell the Command Prompt that the space is included within the directory name itself. This can be done by trying the same command manually, with the path to the directory put within quotes this time, such as:

      icacls “H:\Games Archive*” /T /L /Q /C /RESET

      Try this and let us know if it fixes the issue!

      Like

  3. Great! I’ve followed the paranoid method for getting Program Files into some sort of order. Now I wonder if the same command line can be used on the entire C: partition which I attempted to take ownership of with a program called Permissions Time Machine and regretted immediately. Would it run on C:**

    Like

    1. Ah, I too had set out on a perilous quest of admin-ing literally everything on my system drive; which then landed me in a mess that made me search for this tool and try it out. It worked for me! Turns it the tool knows all the default permissions for Windows-related files and directories, which is the majority of the default C: drive. So, go ahead!

      Like

  4. I see a lot of “Invalid Handle” and “Access denied” messages.

    I WISh there was a way to COMPLETELY DESTROY all this crazy permissions shh*t. It’s for a HOME PC, where NO ONE ELSE works on, except me.

    Like

    1. What up, Mike!

      I know, right? Permissions related shit is just a mess, I have never completely properly understood the workings of it, hahah! Coming to the issue, following the guide properly regardless of the error messages you are shown should do the job. Did you follow through completely? Ignore those errors and check if your initial issue has solved after the tool’s use.

      Do update!

      Like

  5. I think other site proprietors should take this website as an model, very clean and great user genial style and design, let alone the content. You’re an expert in this topic!

    Like

  6. Simply want to say your article is as astounding. The clearness on your submit is just spectacular
    and that i could assume you’re knowledgeable on this subject.
    Fine together with your permission allow me to clutch your feed to stay up to date
    with forthcoming post. Thanks 1,000,000 and please continue the enjoyable work.

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.