Re: Unable to delete a registry key
- From: Gerry Hickman <gerry666uk@xxxxxxxxxxxxxxxx>
- Date: Tue, 03 Oct 2006 22:45:20 +0100
Hi,
The first thing I'd do is ditch VSScript, the second thing I'd do I obtain Return Values from each method call and then test them. The RetVal will give you a clue regarding the reason a delete op does not succeed.
Rikki wrote:
Hi,
I have problem deleting a Registry Key using WMI. Here is the script:
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & StrComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\ODBC\ODBC.INI"
strKeyPath1 = "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"
StrStringValueName = NameODBC
oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath
oReg.DeleteValue HKEY_LOCAL_MACHINE, strKeyPath1, StrStringValueName
I try to delete strKeyPath but nothing happen. I succeed with deleting the value.
I tried to use
strKeyPath = "SOFTWARE\ODBC\ODBC.INI\" &NameODBC but the result is same.
Please advice.
Thank you
--
Gerry Hickman (London UK)
.
- Prev by Date: Re: Using WMI from Within a service.
- Next by Date: Re: Unable to delete a registry key
- Previous by thread: Multiple WMI Connections
- Next by thread: Re: Unable to delete a registry key
- Index(es):
Loading