Wednesday, April 22, 2009

Repairing registry permissions

You may need to reset the registry and file permissions if you experience Access is denied error when installing a Windows XP Service Pack or update. (Example: Service Pack 3 setup error. Access is denied.)

Note: Access denied errors can also be caused by third-party applications, especially anti-virus or anti-spyware applications. So, make sure that you close all the anti-virus and anti-spyware utilities temporarily and then install the Service Pack. This helps in most cases. You should reset the registry and the file permissions only if necessary.

Resetting the Registry and the File Permissions

Using SECEDIT.EXE in Windows XP Professional

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%\repair\secsetup.inf /db secsetup.sdb /verbose

For more information, see article How to reset security settings back to the defaults.

Using SubInACL

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.

cd /d “%ProgramFiles%\Windows Resource Kits\Tools”
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f
subinacl /subdirectories %SystemDrive% /grant=administrators=f
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=system=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=system=f
subinacl /subdirectories %SystemDrive% /grant=system=f

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:\Windows\Svcpack.log using Notepad and look for the text Access is denied or DoRegistryUpdates failed.


No comments:

Post a Comment