Reset Registry and File/Folder Permissions in Windows

Using SECEDIT.EXE in Windows XP/Vista/Windows 7

In Windows XP Professional, you may use the following secedit command-line to reset the file and registry permissions to defaults.

secedit /configure /cfg %windir%repairsecsetup.inf /db secsetup.sdb /verbose

Using SubInACL in Windows XP/Vista/Windows 7

For Windows XP Home Edition (and Professional Edition), you may use the SubInACL tool to reset the registry and file permissions. Download and then install the Subinacl.exe (~370 KB) from Microsoft. SubInACL is a command-line tool that enables administrators to obtain security information about files, registry keys, etc.

Open Notepad, copy the commands below and save the file as reset.cmd. Double-click the file to run it. This script file may take a long time to run. Registry and file permissions in your system should be reset.

Add this code into Notepad and save the file as "Reset.cmd"

cd /d "%ProgramFiles%Windows Resource KitsTools"
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%repairsecsetup.inf /db secsetup.sdb /verbose

Double click on Reset.cmd this will reset all your system permissions to out of the box defaults, once complete reboot your computer!

Note: If you’re seeing the error Service Pack 3 setup error. Access is denied when installing Windows XP Service Pack 3, to verify if the error is caused by incorrect registry permissions, open the file C:WindowsSvcpack.log using Notepad and look for the text Access is denied or DoRegistryUpdates failed.