I'm trying to invoke the createkey method under StdRegProv but I can't seem
to get the first
imparam correct
it says that "Value was either too large or too small for a UInt32 when it
processes current_user."
how do I pass a UInt32 value? Msdn has it listed as 0x80000001, but
vb.net won't except that. hDefKey only accepts uint32 values... or so it
seems.
Const HKEY_current_user As Long = &H80000001
Dim strkeypath As Object = "Software\Microsoft\Internet Explorer\Main\mas"
Dim wmi As ManagementClass
Dim md As MethodData
Dim RemotePC As String
RemotePC = "."
wmi = New ManagementClass("\\" & RemotePC & "\root\default:StdRegProv")
Dim inParams As ManagementBaseObject = wmi.GetMethodParameters("Createkey")
inParams("hDefKey") = HKEY_current_user
inParams("sSubKeyName") = strkeypath
Dim outParams As ManagementBaseObject = wmi.InvokeMethod("Createkey",
inParams, Nothing)
' Display results
' Note: The return code of the method is provided in the "returnValue"
property of the outParams object
Console.WriteLine("Creation of registry returned: {0}",
outParams("returnValue"))
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---