Overblog
Editer l'article Suivre ce blog Administration + Créer mon blog

VBS: REGEDIT: Get valuename for valuevalue

Publié le par damcuvelier

 

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

N
<br /> Bonsoir,<br /> <br /> Est-il possible de récupérer valuetype à partir de valuename en récursif, si on a pas besoin de valuevalue sur un hive distant ?<br /> <br /> <br />
Répondre
D
<br /> <br /> Je ne suis pas développeur donc tu serais gentille de "me parler meilleur".<br /> <br /> <br /> Rien Compris<br /> <br /> <br /> <br />
D
Peux-tu détailler? J'ai mal compris