J'ai cherché sur Purearena, testé différente libs comme Droopy, regini et jhregistry mais les si cela fonctionne pour des clés en texte simple, je n'arrive pas a obtenir une REG_EXPAND_SZ.
Je souhaite lire et écrire dans HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
la clé DevicePath.
En vbs, cela donne
Code : Tout sélectionner
Const HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion"
strValueName = "DevicePath"
oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath, _
strValueName,strValue
Wscript.Echo "DevicePath=: " & strValueConst HKEY_LOCAL_MACHINE = &H80000002
Code : Tout sélectionner
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion"
strValueName = "DevicePath"
strValue = "titi"
oReg.SetExpandedStringValue _
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
Fred, pourrais tu nous faire une gestion de la registry ?
Merci d'avance et bon dimanche.