Page 1 sur 1

[RESOLU] fonction readstring registry

Posté : 03 avr. 2025 - 11:01
par guigeek
Bonjour,
j'ai un soucis pour aller lire une registry spécifique :
Arrivez-vous à lancer cette commande ?

Code : Tout sélectionner

 registry_readstring(HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Group Policy\\State\\Machine\\Scripts\\Shutdown\\0\\0','Script')
Moi j'ai toujours un résultat vide.

La commande fonctionne pourtantsur arborescence supérieure par exemple

Code : Tout sélectionner

registry_readstring(HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Group Policy\\State\\Machine\\Scripts\\Shutdown\\0','DisplayName')
De même, si j'utilise reg_key_exists la fonction a un retour particulier :

Code : Tout sélectionner

reg_key_exists(HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Group Policy\\State\\Machine\\Scripts\\Shutdown\\0')
Renvoie True

mais

Code : Tout sélectionner

reg_key_exists(HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Group Policy\\State\\Machine\\Scripts\\Shutdown\\0\\0')
Renvoie

Code : Tout sélectionner

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Program Files (x86)\wapt\waptutils.py", line 2786, in reg_key_exists
    with reg_openkey_noredir(rootkey, subkeypath):
AttributeError: __enter__
Une idée de ce comportement ?

Merci !
Bonne journée,

Re: fonction readstring registry

Posté : 03 avr. 2025 - 11:53
par guigeek
Désolé je viens de voir c'etait un problème droits.
En admin ca marche .

Re: fonction readstring registry

Posté : 04 avr. 2025 - 12:56
par dcardon
Bonjour Guillaume,
guigeek a écrit : 03 avr. 2025 - 11:53 Désolé je viens de voir c'etait un problème droits.
En admin ca marche .
Pas de soucis, ça arrive même aux meilleurs ;)

Cordialement,

Denis