registry

Python code to read registry

Python code to read registry Question: from _winreg import * “””print r”*** Reading from SOFTWAREMicrosoftWindowsCurrentVersionRun ***” “”” aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE) aKey = OpenKey(aReg, r”SOFTWAREMicrosoftWindowsCurrentVersionUninstall”) for i in range(1024): try: asubkey=EnumKey(aKey,i) val=QueryValueEx(asubkey, “DisplayName”) print val except EnvironmentError: break Could anyone please correct the error…i just want to display the “DisplayName” within the subkeys of the key …

Total answers: 5

Windows is not passing command line arguments to Python programs executed from the shell

Windows is not passing command line arguments to Python programs executed from the shell Question: I’m having trouble getting command line arguments passed to Python programs if I try to execute them directly as executable commands from a Windows command shell. For example, if I have this program (test.py): import sys print “Args: %r” % …

Total answers: 12