Je souhaite créer dans la clé de registre HKEY_LOCAL_MACHINE\COMPONENTS
la valeur : StoreCorruptTimeStamp
C'est pour le CheckSur, voir ce lien
Au départ j'ai fait un RegWrite direct de la valeur (alors que dans mon registre la clé HKEY_LOCAL_MACHINE\COMPONENTS n'existe pas) et ça ne fonctionne pas.
Du coup je me suis dit qu'en créant d'abord la clé par défaut ça le ferait mieux, nada à priori
Ne comprenant pas je tente de créer une clé pour tester, "un niveau au dessous " : HKEY_LOCAL_MACHINE\SOFTWARE\TataYoyo (qui n'existe pas non plus dans le registre), par contre bien entendu HKEY_LOCAL_MACHINE\SOFTWARE existe, et là ça fonctionne
du coup je capte pas trop
Voici le bout de code que je viens de tester :
Code : Tout sélectionner
Local $Buff = 'ça le fait !!!!'
Local Const $HKLM_Components = 'HKEY_LOCAL_MACHINE\COMPONENTS' ;Je voudrais créer Components
Local Const $TataYoyo = 'HKEY_LOCAL_MACHINE\SOFTWARE\TataYoyo' ;Je voudrais créer TataYoyo
Test()
MsgBox(0, "", $Buff)
Func Test()
$Res = RegRead($HKLM_Components, "") ;test si clé existe
If @error Then ; si non je la créé
$Res = RegWrite($HKLM_Components)
If @error Then
$Buff = "[Error] Updating registry impossible error 1 - " & @error
EndIf
EndIf
$Res = RegRead($TataYoyo, "") ;test si clé existe
If @error Then ; si non je la créé
$Res = RegWrite($TataYoyo)
If @error Then
$Buff &= @CRLF & "[Error] Updating registry impossible error 2 - " & @error
EndIf
EndIf
EndFunc
Merci et bonne soirée
[EDIT]Je n'ai pas essayé via le .reg ou via un reg add en ligne de commande qui pourraient être une alternative vous me direz :siffle:



