The RegDelete method of Windows Script Host cannot delete keys that contain subkeys (279847)
The information in this article applies to:
- Microsoft Windows Script Host 1.0
- Microsoft Windows Script Host 2.0
- Microsoft Windows Management Instrumentation 1.0
- Microsoft Windows Management Instrumentation 1.1
- Microsoft Windows Management Instrumentation 1.2
- Microsoft Windows Management Instrumentation 1.5
This article was previously published under Q279847 Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base: 256986 Description of the Microsoft Windows registry SYMPTOMS
Windows Script Host (WSH) will return the error message
Unable to remove registry key "<path to registry key>"
if an attempt is made to delete a key that contains subkeys.
CAUSE
Windows Script Host does not have the capability to enumerate subkeys of a registry key.
RESOLUTION
One way to work around this problem is to use Windows Management Instrumentation to enumerate a registry key and modify any information necessary.
Another option is to use the ActiveX control RegObj.dll (see "References" for information about downloading this control).
STATUS
This behavior is by design.REFERENCES
For more information about WMI, see the following MSDN Web site:
You can download RegObj.dll from the following Microsoft Web site:
Modification Type: | Major | Last Reviewed: | 5/2/2006 |
---|
Keywords: | kbDSWManage2003Swept kbprb KB279847 |
---|
|