Resetting permissions on system files and registry keys after they are altered by a virus, malware, or corruption, is nearly impossible to accomplish manually. I common sign of such a problem is registry keys and files that appear to have no owner because you don’t have permission to view the owner. If you’ve tried working around this – fixing a few so one thing would load, and then going back for the next, and the next, this short procedure will provide you relief. This script will reset the permissions correctly.
Download the SubInACL.msi from Microsoft and install it.
Copy the following text and paste it into notepad:
cd “\%ProgramFiles%\Windows Resource Kits\Tools”
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f
subinacl /subdirectories %SystemDrive% /grant=administrators=f /grant=system=f
subinacl /subdirectories %windir%\*.* /grant=administrators=f /grant=system=f
secedit /configure /cfg %windir%\repair\secsetup.inf /db secsetup.sdb /verbose
Save the file with an extension of .cmd. For example, “reset.cmd”. You will need to run this from the command line, so save it to a place where you can easily access it.
Now go to a command prompt and run the file. In Windows 7 you will have to start the command prompt with elevated privileges. To do this, click start>accessories, then right click on Command Prompt and select “Run as Administrator”
When the command line opens, go to the folder where you saved the reset.cmd file. To do this type cd \foldername, or just cd \ if you saved the file to the root of C:. Then type reset.cmd and press enter.
It may take a few minutes for the script to complete. When it is done, exit the command prompt and restart your computer.