' =============================================================
' function : RegistryRead
' desc : Read a value from the registry
' params : strRoot is the root key, i.e. "HKLM", "HKCU"
' strPath is the path to read, i.e.
' "Software\Test\Automation"
' returns : Value from the registry key
' =============================================================
Function RegistryRead(strRoot, strPath)
' create the shell object
Set objShell = CreateObject("WScript.Shell")
' read the key
strValue = objShell.RegRead(strRoot & "\" & strPath)
' return the value
RegistryRead = strValue
' destroy the object
Set objShell = Nothing
End Function 'RegistryRead
' function : RegistryRead
' desc : Read a value from the registry
' params : strRoot is the root key, i.e. "HKLM", "HKCU"
' strPath is the path to read, i.e.
' "Software\Test\Automation"
' returns : Value from the registry key
' =============================================================
Function RegistryRead(strRoot, strPath)
' create the shell object
Set objShell = CreateObject("WScript.Shell")
' read the key
strValue = objShell.RegRead(strRoot & "\" & strPath)
' return the value
RegistryRead = strValue
' destroy the object
Set objShell = Nothing
End Function 'RegistryRead
0 comments:
Post a Comment