473,395 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Remote Win32 Registry confusion?

Folks,

I am having difficulty with *reading* the registry from a remote Windows
box...

1) I need to impersonate a different user name & password, then the
user I
am currently logged in as.
(i.e. access the registry as a administrator)

2) The registry to be examined is on a different machine...

3) I just need the key entry returned....

For example
\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DrWatson\Ap pendToLogFile
returning the value it has been saved with.

I by no means am a Win32 Python expert, but I usually can muddle my way
through....
But I am missing something here... And I am not sure what...

I have proof of concept VBScript code....

strroot = "HKEY_LOCAL_MACHINE"
strKeyPath = "\SOFTWARE\Microsoft\DrWatson"
strKey = "AppendToLogFile"

Dim arrValues
strKeyPath = "\SOFTWARE\Microsoft\DrWatson"
strKey = "AppendToLogfile"
objRegister.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strKey,
value

Wscript.Echo value

Here's the code that I have attempted to use.... Can anyone point out
what
I am missing?

It works fine locally, but I can't figure out how to assign the user
account
and password for the remote system.

import _winreg
import win32com.client

host = "127.0.0.1" # local host
key = _winreg.ConnectRegistry(host, _winreg.HKEY_LOCAL_MACHINE)
hkey = _winreg.OpenKey(key,
r"Software\Microsoft\Windows\CurrentVersion\Uninst all")
num = _winreg.QueryInfoKey(hkey)[0]
print "*** Found %d Software ***" % num

try:
for x in range(1000):
uninstall = _winreg.EnumKey(hkey, x)
skey = _winreg.OpenKey(key,
"Software\Microsoft\Windows\CurrentVersion\Uninsta ll\%s" % uninstall)
try:
software = _winreg.QueryValueEx(skey, "DisplayName")[0]
print "%s-%s" % (uninstall, software)
except:
pass
except:
pass
Jul 18 '05 #1
0 1618

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cherry | last post by:
Hi, can I access the registry of a remote machine using VB.NET? While connecting to the remote machine I would be using the admin login of that machine. Thanks.
0
by: News.microsoft.com | last post by:
I keep getting a security error when trying to access a remote registry could someone please help or post code which will correct the error I am getting on the following line clsRemoteRegKey =...
3
by: Slimo | last post by:
Hello, I'm searching some example of code (VB) for reading remote registry subkeys and keys. Thanks
5
by: Parv | last post by:
I am working in a domain environment. I am on a client machine and wants to edit registery of domain server. I am currently in a Domain user account and member of Domain administrators on the...
3
by: Geoff McElhanon | last post by:
I have been struggling with a security issue that occurs under .NET 2.0, but does not occur under .NET 1.1. Essentially I am trying to open up a performance counter on a remote server and monitor...
4
by: Chuck B | last post by:
I am modifying remote registries for about 150 computers. Is there any easy way in C# to do a remote registry backup?
3
by: CAIBird | last post by:
hi, i'm wondering how to reader or write registry of a remote host. are there any classes help? Thanks in advance -Zhilin
12
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i current have a way to read both local and remote machines registry keys and create a textual view (.txt output). i now looking for ways to do export of local and remote mahcine registry keys...
3
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
Hi: I'm looking for an example of modifying the registry of a remote system. Thanks much! Charles
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.