Sie sind nicht angemeldet.
.
Zitat
doofe frage... aber was macht dieses programm überhaupt?
(eigentlich war es ursprünglich nur dazu gedacht, meine Programmier-kenntnisse zu verbessern, aber da es ganz praktisch ist, stell ich es halt auch online ;D).

|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
#!/usr/bin/env python
"""WindowsUninstallEntries.py -- Version 27-Oct-2004
Extract applications' uninstall entries from the Windows registry
and write them to plain text files.
Released under the terms of the GNU General Public License
_ _
| |_ ___ _____ ___ _ _ _ ___ ___| |_
| | . | | ._| | | | . | _| . /
|_|_|___|_|_|_|___|_____|___|_| |_|_\
[url]http://homework.nwsnet.de/[/url]
"""
import _winreg
def fetchSubKeys(hkey, key):
"""Fetch subkeys from a registry key."""
# connect to registry and open key
reg = _winreg.ConnectRegistry(None, hkey)
key = _winreg.OpenKey(reg, key)
# fetch subkeys
subkeyCount = _winreg.QueryInfoKey(key)[0]
subkeys = []
for i in range(subkeyCount):
subkeys.append(_winreg.EnumKey(key, i))
# close key and disconnect from registry
_winreg.CloseKey(key)
_winreg.CloseKey(reg)
return subkeys
def writeSequenceToFile(seq, filename):
"""Loop through the sequence and write its values to the file."""
f = open(filename, 'w')
for v in seq:
f.write(v + '\n')
f.close()
def main():
# extract software uninstall entries from HKEY_CURRENT_USER
writeSequenceToFile(
fetchSubKeys(
_winreg.HKEY_CURRENT_USER,
r'Software\Microsoft\Windows\CurrentVersion\Uninstall'
),
'apps-currentuser.txt'
)
# extract software uninstall entries from HKEY_LOCAL_MACHINE
writeSequenceToFile(
fetchSubKeys(
_winreg.HKEY_LOCAL_MACHINE,
r'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
),
'apps-localmachine.txt'
)
print 'Done.'
if __name__ == '__main__':
"""Execute if script is directly called."""
main()
|
-