Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gmmastros on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

_winreg EnumValue problems

Status
Not open for further replies.

timgerr

IS-IT--Management
Jan 22, 2004
364
0
0
US
I am new to python and want to learn this language. I am having troubles finding examples and tutorials for use on windows boxes. I do most of my stuff in perl and php but want better socket support, so I am giving python a try. I am writing a script to connect to remote registry's because of this new IM virus. I can create reg entries and delete them but I cannot enumerate them, here is my code.
Code:
import _winreg

host = "127.0.0.1" # local host
key = _winreg.ConnectRegistry(host, _winreg.HKEY_LOCAL_MACHINE)
E_key = _winreg.EnumValue(key, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
I get an error when I run the script:
Code:
Traceback (most recent call last):
  File "reg4.py", line 9, in ?
    E_key = _winreg.EnumValue(key, r"SOFTWARE\Microsoft\Windows\CurrentVersion\R
un")
TypeError: an integer is required

Can someone tell me what I am doing wrong?

Thanks

-How important does a person have to be before they are considered assissinated instead of just murdered?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top