[Tutor] Window Registry Access

Gooch, John John.Gooch at echostar.com
Wed Oct 27 22:19:22 CEST 2004


I am attempting to read information from a remote registry using Python, but
cannot find any examples of it in the Python/Activestate mailing list
archives nor plain old Google.com. Can someone point out what I am doing
wrong? The below code is what I am using, and it errors on the 'successful='
line, telling me I am giving it invalid parameters. The parameters I am
unsure of are the first and last ones, as , once again, I can find no
documentation as to what they should be in Python. 
------------------------------
Microsoft documentation says
this->http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisd
k/wmi/getstringvalue_method_in_class_stdregprov.asp
uint32 GetStringValue(
  uint32 hDefKey,
  string sSubKeyName,
  string sValueName,
  string sValue
);

-------------------------------


My Code
----------------------
wmiRegObj = win32com.client.GetObject(
r'winmgmts://somesystem/root/default:StdRegProv')
if wmiRegObj:
   print "Successfully connected to registry"
  successful = wmiRegObj.GetStringValue( 'HKEY_LOCAL_MACHINE',
'SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\' ,
'DefaultUserName', username )   
 

John A. Gooch
Systems Administrator
IT - Tools
EchoStar Satellite L.L.C.
9601 S. Meridian Blvd.
Englewood, CO  80112
Desk: 720-514-5708 


-----Original Message-----
From: Christian Wyglendowski [mailto:Christian.Wyglendowski at greenville.edu] 
Sent: Wednesday, October 27, 2004 8:32 AM
To: Kent Johnson; Bill Mill
Cc: tutor at python.org
Subject: RE: [Tutor] Turning a "script" into an "application"


Bill, Kent, Joe,

Thanks a lot for openly discussing the different approaches to my problem.
With your help, I have gained some insight into the problem area that I am
tackling, and that's what I was looking for.

The multiprocess socket/XMLRPC option is very exciting in that I could
create a generic "sniffer server" that can talk with whatever client(s) I
decide to create.

The all-in-one threaded option is tempting for a couple reasons:
	1.  I would like to get some experience with threads.
	2.  Overall, the architecture sounds less complex.

For the sake of flexibility, I am leaning towards the multiprocess option
using XMLRPC.

Thanks again for the ideas/counter-ideas!

Christian
http://www.dowski.com

_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list