the folling two lines represent an export from a registry
key.
[HKEY_LOCAL_MACHINE\SYSTEM\...\Ac97]
"MasterVolume"=hex:07,07
i would like to use the value in a script as a decimal
value. sadly i did not find any solution for this yet.
i would appreciate any help.
thank you,
lapa
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKLM\SYSTEM\...\Ac97\MasterVolume", &H0707, "REG_BINARY"
it would be enough to know if its equal to sg. (i would
like to know if the current volume level equals one of 5
predefined values to fade the volume level from one to
another. the current value is the only thing i miss for
the code...
thanks again.
>.
>
> the folling two lines represent an export from a registry
> key.
>
> [HKEY_LOCAL_MACHINE\SYSTEM\...\Ac97]
> "MasterVolume"=hex:07,07
>
> i would like to use the value in a script as a decimal
> value. sadly i did not find any solution for this yet.
Hi
I think this should work:
Set oShell = CreateObject("WScript.Shell")
sRegValue = "HKLM\SYSTEM\.........\Ac97\MasterVolume"
aRegData = oShell.RegRead(sRegValue)
For i = 0 To UBound(aRegData)
vHexVal = vHexVal & Right("0" & Hex(aRegData(i)), 2)
Next
WScript.Echo CLng("&H" & vHexVal)
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter