Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Is there a way to programmatically turn on remote registry?

Reply
Thread Tools

Re: Is there a way to programmatically turn on remote registry?

 
 
Tim Golden
Guest
Posts: n/a
 
      10-24-2012
On 24/10/2012 14:26, Kevin Holleran wrote:
> On Wed, Oct 24, 2012 at 9:11 AM, Tim Golden <(E-Mail Removed)
> Ok, try specifying the parameter names. (I remember someone having
> problems before caused by mismatched param order):
>
>
>
> OK, tried that as well as specifying the parameters directly instead of
> through variables, with the same result.... I even looked back through
> my old scripts but I have not used the WMI module in this way... only to
> do WMI queries...


Couple of things:

Does the same thing happen if you run against your own machine?

What's the result of the code below (which is basically "raw" WMI,
without the wmi module):

<code>
import _winreg as winreg

import win32com.client

HKLM = winreg.HKEY_LOCAL_MACHINE
NICs =
"SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E 972-E325-11CE-BFC1-08002bE10318}"

registry = win32com.client.GetObject("winmgmts:/root/default:StdRegProv")
EnumKey = registry.Methods_("EnumKey")
params = EnumKey.InParameters.SpawnInstance_()
params.Properties_.Item("hDefKey").Value = HKLM
params.Properties_.Item("sSubKeyName").Value = NICs

OutParameters = registry.ExecMethod_("EnumKey", params)
print OutParameters.Properties_.Item("ReturnValue")
print OutParameters.Properties_.Item("sNames")


</code>

TJG

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Is there a way to programmatically turn on remote registry? Tim Golden Python 0 10-22-2012 07:29 PM
Re: Is there a way to programmatically turn on remote registry? Dennis Lee Bieber Python 0 10-22-2012 07:28 PM
Re: Is there a way to programmatically turn on remote registry? Tim Golden Python 0 10-22-2012 03:05 PM
Re: Is there a way to programmatically turn on remote registry? Dennis Lee Bieber Python 0 10-20-2012 12:56 AM
RE: Is there a way to programmatically turn on remote registry? Prasad, Ramit Python 0 10-19-2012 08:18 PM



Advertisments