Micro Focus QTP (UFT) Forums

Full Version: RegRead Method help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

im trying to get the value off this reg path:
HKLM\SOFTWARE\ASDF_GHJKL\Data-Dir\system
via vb

Code:
Dim WshShell, bkey
  set WshShell = WScript.CreateObject("WScript.Shell")
    bKey = WshShell.RegRead("HKLM\SOFTWARE\ASDF_GHJKL\Data-Dir\system")

@the line 2 i get an error.
object requiered `Wscript´


Someone has a solution?

best regards,
Konstantin
Hi,
ignore WScript...Try this code

Code:
set WshShell = CreateObject("WScript.Shell")
bKey = WshShell.RegRead("HKLM\SOFTWARE\ASDF_GHJKL\Data-Dir\system")
thank you for your answer, helped me a lot

im getting this error, but the path is right
Code:
set WshShell = CreateObject("WScript.Shell")
KeyVal= WshShell.regread("HKEY_LOCAL_MACHINE\SOFTWARE\******-*****\DataDir\System")
Problem solved