Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A few months ago I got my computer, and instead of sticking with the preinstalled Windows 7 Home Premium and OEM stuff I decided I want a clean install from a DreamSpark disc. At the time I also wanted to install Ubuntu, but because it's my only computer, I wanted to have something comfortable to use while adding in Ubuntu later. When I decided to install Ubuntu, I first backed up my existing Windows installation with Paragon Backup & Recovery 10, then I proceeded to install Ubunutu. I ended up having to repartition because I wanted to keep the recovery partition as-is, so I added an extended partition into the first primary partition, wiping out the installation. I restored from my backup after Ubuntu was installed and rejigged the bootloader.

Shortly after that I noticed Windows Installer wouldn't install programs correctly, and noticed that the permission of every single file and directory had been set to Everyone/Full Control, and none had any special permissions for SYSTEM or Administrators or Users. So I did what I can and manually applied some permissions from another Windows 7 system. Things worked generally well after that. Last week, I was looking at the permissions again, and realized having the Everyone permission on everything pretty much defeats the purpose of having permissions, and I removed it from places that shouldn't have them (like the Windows folder, Program Files, parts of Users). Unfortunately, it seems now it borked a few system services. Windows Installer stopped working again, Windows Update fails to apply updates, and the Event Log service disappeared from the Services console.

What I'd like is to programatically overwrite the permissions on my hard drive with permissions from a stock installation. I have a Windows 8 VM ready, and can make a Windows 7 VM if necessary. The only problem is how to apply the permissions. A search around yields a "Copy-Acl" cmdlet, and I think it might work, but I haven't been able to mount the VM disk. I would like to avoid clean reinstallation if possible because backups would take forever, and TBH I don't have a big enough drive (I've got 200GB of files, and a lot of loose ones at that). What options do I have for fixing the ACL, and if cloning from existing installation is acceptable, how do I mount the virtual disk and proceed with copying over the ACL?

share|improve this question
That Copy-Acl is not a native PowerShell cmdlet, you will have to copy it from that site. That said, it's written by a top PowerShell professional so I would trust it. I also see it provides an example of usage. – Guy Thomas Feb 28 '13 at 8:33
CD /D D:
takeown /R /F *

Then set permissions as per This link

I used this once to recover a system which was having problems with file permissions.

Boot to a PE environment such as Bart PE or WinPE and execute these commands.

CD /D D:

This will change your current drive letter to D: (See This Link)

takeown /R /F *

This will take ownership fo all files and folders in the tree below D: and set ownership to the current user (See This Link)

As this is going to modify a lot of file permissions en masse, make sure you take a good backup of all your data first.

Also, please note this solution has not been tested by me in a good couple of years now and I have no test kit to proof this on - it is meant as guidance only.

share|improve this answer

You must log in to answer this question.

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