VBS: REGEDIT: Get valuename for valuevalue
dim strComputer : strComputer = "."
dim oReg
dim value,valeur
'// Registry variables:
const HKEY_LOCAL_MACHINE = &H80000002
dim strKeyPath : strKeyPath = "<strKeyPath>"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
wscript.echo "value_fr = " & valuename (valeur)
function valuename (valtoget)
oReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrValueNames
For i=0 To UBound(arrValueNames)
oReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath ,arrValueNames(i),value
if value = valtoget) then
valuename = arrValueNames(i)
exit for
end if
Next
end function
Commenter cet article