Wednesday, July 16, 2014

Removing Registry key Using VB Scripts

Const HKEY_CLASSES_ROOT  = &H80000000
Const HKEY_CURRENT_USER  = &H80000001
Const HKEY_LOCAL_MACHINE  = &H80000002
Const HKEY_USERS   = &H80000003
Const HKEY_CURRENT_CONFIG  = &H80000005

strComputer = "."

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\V6R2012x"
strKeyPath1="SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\EE9929DE5563356CDE4A7CA7331EF14A"


oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath
oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath1

No comments:

Post a Comment