cooljam23
asked on
Delete registry key with VBS
Hi,
Just need a simple vbs script to delete registry key in windows
thanks
Just need a simple vbs script to delete registry key in windows
thanks
i found this example:
Deleting a Registry Key
Uses WMI to delete the registry key HKLM\SOFTWARE\System Admin Scripting Guide.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{
strComputer & "\root\default:StdRegProv"
strKeyPath = "SOFTWARE\System Admin Scripting Guide"
oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath
Deleting Registry Values
Uses WMI to delete all the registry values under HKLM\SOFTWARE\System Admin Scripting Guide.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{
strComputer & "\root\default:StdRegProv"
strKeyPath = "SOFTWARE\System Admin Scripting Guide"
strDWORDValueName = "DWORD Value Name"
strExpandedStringValueName
strMultiStringValueName = "Multi String Value Name"
strStringValueName = "String Value Name"
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyP
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyP
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyP
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyP
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
From vb help files...
DeleteSetting appname, section[, key]
Bob