Scripts Thread, Delete HKCR key in Coding and Web Development; Is there a special way to remove a reg key from classes root? I have a script that works fine ...
4th March 2010, 03:47 PM #1
Delete HKCR key
Is there a special way to remove a reg key from classes root? I have a script that works fine when removing keys from HKLM but it fails to delete a key in HKCR. The first two entries are deleted every time but the third errors saying 'Unable to remove registry key' 80070002. I can remove the key using regedit so it's not being held open.
On Error Resume Next
Dim WshShell, bKey
Set WshShell = WScript.CreateObject("WScript.Shell")
set WSHSHell = Nothing
4th March 2010, 04:00 PM #2
but I think HKCR should work (HKCR is just an alias to the "real" location)
Error 0x80070002 means "not found" so are you sure of the spelling??
4th March 2010, 04:23 PM #3
Sorted it, I needed a trailing slash at the end to delete subkeys.
Last edited by cookie_monster; 4th March 2010 at 04:32 PM.
By moggy in forum Hardware
Last Post: 26th April 2010, 03:13 PM
By bladedanny in forum Hardware
Last Post: 15th May 2009, 05:30 PM
Last Post: 26th January 2009, 11:37 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)