da ich noch Anfänger bin, Kleinigkeiten habe ich schon mit Python gemacht, stehe ich nun vor einem Problem und zwar möchte ich als praktische und gleichzeitig sinnvolle Übung auf der Arbeit, meine .reg Dateien Sammlung zukünftig via Python ausführen.
nach mehrfachen probieren und lesen des moduls auf python.org, muß ich jetzt kapitulieren, da keine Beispiele aufgeführt sind und ich die Funktionen einfach nicht anhand von fehlenden veranschaulichten Beispielen verstehe, würde ich mich freuen wenn man es mir erklären könnte bzw. den code mal aufschreibt, damit ich mir den rest erarbeiten kann.
z.b. folgende zwei Registry Einträge als Beispiel.
Code: Alles auswählen
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Microsoft Forefront\Client Security\1.0\AM\Signature Updates]
"CheckAlternateDownloadLocation"=dword:0Code: Alles auswählen
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Microsoft Forefront\Client Security\1.0\SSA\ScanAction]
"Parameter"="<ScanJob Version='1.0' Culture='1031'> <Manifest ConfigFile='VulnerabilityDefinitions.manifest' ConfigVersion='1.0.0.0'/> </ScanJob>"wie gelingt mir das per python ?
habe python 3.2
schon mal vielen dank
Edit: Suchfunktion habe ich schon benutzt, nur hat mir das leider nicht geholfen
Edit2:
Code: Alles auswählen
_winreg.SetValueEx(key, value_name, reserved, type, value)¶
Stores data in the value field of an open registry key.
key is an already open key, or one of the predefined HKEY_* constants.
value_name is a string that names the subkey with which the value is associated.
type is an integer that specifies the type of the data. See Value Types for the available types.
reserved can be anything – zero is always passed to the API.
value is a string that specifies the new value.
This method can also set additional value and type information for the specified key. The key identified by the key parameter must have been opened with KEY_SET_VALUE access.
To open the key, use the CreateKey() or OpenKey() methods.hoffe ich habe mein Problem gut beschrieben
Edit3:
Code: Alles auswählen
import winreg
winreg.CreateKey(
winreg.HKEY_LOCAL_MACHINE,
"SOFTWARE\\Policies\\Microsoft\\Microsoft Forefront\\Client Security\\1.0\\AM\\Signature Updates")
winreg.SetValueEx(????, "CheckAlternateDownloadLocation", ????, winreg.REG_DWORD=0, ???? 