From MS KB 873148:
You receive an "Access is denied" error message when you try to install
Windows XP
Service Pack 2
Important This article contains information about modifying the registry.
Before you
modify the registry, make sure to back it up and make sure that you
understand how to
restore the registry if a problem occurs. For information about how to back
up,
restore, and edit the registry, click the following article number to view
the
article in the Microsoft Knowledge Base:
256986 Description of the Microsoft Windows Registry
SYMPTOMS
When you try to install Microsoft Windows XP Service Pack 2 (SP2), you may
experience
the following issues:
You cannot install the service pack.
You receive the following error message:
Service Pack setup has failed. Access Denied
The Setupapi.log file contains references that indicate that one
or more
registry keys could not be deleted while the Setup program was running.
CAUSE
These issues may occur when permissions on one or more registry keys are
restricted
in a way that prevents the administrator who installs the update from
updating the
registry keys. Failure to update a registry key causes the Setup program to
fail.
WORKAROUND
Warning If you use Registry Editor incorrectly, you may cause serious
problems that
may require you to reinstall your operating system. Microsoft cannot
guarantee that
you can solve problems that result from using Registry Editor incorrectly.
Use
Registry Editor at your own risk.To work around this issue, examine the
Svcpack.log
file to find the registry keys that are causing this issue, and then modify
the
registry permissions to give access to the user who is trying to install the
service
pack. To do this, follow these steps:
1. Make sure that the user who is trying to install the
service
pack is a member of the Administrators security group.
2. Open the Svcpack.log file. By default, this file is
located in
the C:\Windows folder.
3. Search the log file for references to registry
permissions
issues. Make a note of the registry keys that are referenced.
4. Click Start, click Run, type regedit, and then click OK
to start
Registry Editor.
5. Locate and right-click the registry keys that you noted
in step
3 of this procedure, and then click Permissions.
6. Examine the permissions that are configured for each
user or
group. Identify the restricted permissions that are affecting the user who
is trying
to install the service pack. Make sure the Administrators group has full
access
configured.
7. Quit Registry Editor.
After you follow these steps, try again to install the service pack.
The information in this article applies to:
Microsoft Windows XP Home Edition Service Pack 2 (SP2)
Microsoft Windows XP Professional Service Pack 2 (SP2)"
Alternatively:
In Windows XP Professional it may be better to just reset the security
settings back to the defaults for all registry keys, as described in the
following Microsoft Knowledge Base article.
How To Reset Security Settings Back to the Defaults
http://support.microsoft.com/?kbid=313222
If you only want to reset the registry permissions, add this to the secedit
command line:
/areas REGKEYS
Unfortunately Windows XP Home does not have secedit.