• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 551
  • Last Modified:

Delete Registry Key using VBS script

I have been trying to delete the following registry key:
HKEY_CLASSES_ROOT\CLSID\{FBBFF378-921E-4504-972A-66193574213D}

I have written the following script:
const HKEY_CLASSES_ROOT = &H80000000
strComputer = "."
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "CLSID\{FBBFF378-921E-4504-972A-66193574213D}"
objReg.DeleteKey HKEY_CLASSES_ROOT, strKeyPath

It is not working, but does not throw any errors.  Any ideas?
0
Laramie1
Asked:
Laramie1
1 Solution
 
Laramie1Author Commented:
Found the solution at http://207.46.16.252/en-us/magazine/2006.08.scriptingguy.aspx 

The registry key I was trying to remove had subkeys with must be removed first.  The code mentioned in this article worked great.
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now