Is there a way to programmatically turn on remote registry?

Kevin Holleran kdawg44 at gmail.com
Tue Oct 23 08:19:33 EDT 2012


Tim,

I am re-implementing in my script now.  I'll let you know how it goes... I
just realized that the key that I sent over was completely wrong.... I am
not sure how I even got it as it is the combination of two different keys
from two different scripts... must have been working too long and
everything blending together... :)

Thanks for your help!

Kevin


On Tue, Oct 23, 2012 at 4:07 AM, Tim Golden <mail at timgolden.me.uk> wrote:

> On 22/10/2012 21:01, Kevin Holleran wrote:
> > Tim,
> >
> > I am looking here:
> >
> >
> SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BF9F6FB0-C999-4D19-BED0-144F77E2A9D6}
> >
> > Enumerating the keys for a BusType == 5, then grabbing the values of
> > DriverDesc, DriverDate, & DriverVersion.
> >
> > So I am doing this:
>
> [... snip querying uninstallers ...]
>
> I don't have that particular uninstaller key but the code below, using
> the wmi module to hide the plumbing, queries all the installers and
> should give you enough of an idea, hopefully. For brevilty, I've only
> bothered with extracting string values; it would be easy to extract
> other datatypes.
>
> To perform the same query on another computer, just pass the other
> computer name (or IP address) as the first parameter to the wmi.WMI call
> (or use the named param "computer").
>
> <code>
> import _winreg as winreg
> import wmi
>
> HKLM = winreg.HKEY_LOCAL_MACHINE
> UNINSTALLERS = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
>
> registry = wmi.WMI(namespace="default").StdRegProv
> _, names = registry.EnumKey(HKLM, UNINSTALLERS)
> for name in names:
>     print name
>     uninstaller = UNINSTALLERS + "\\" + name
>     _, value_names, value_types = registry.EnumValues(HKLM, uninstaller)
>     for value_name, value_type in zip(value_names, value_types):
>         if value_type == winreg.REG_SZ:
>             _, value = registry.GetStringValue(
>               HKLM, uninstaller, value_name
>             )
>         else:
>             value = "(Non-string value)"
>         print u"  ", value_name, u"=>", value
>
> </code>
>
>
> TJG
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121023/0361372b/attachment.html>


More information about the Python-list mailing list