Micro Focus QTP (UFT) Forums
RegRead Method help - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: RegRead Method help (/Thread-RegRead-Method-help)



RegRead Method help - KonstantinF - 02-03-2009

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


RE: RegRead Method - manojith1984 - 02-03-2009

Hi,
ignore WScript...Try this code

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



RE: RegRead Method - KonstantinF - 02-03-2009

thank you for your answer, helped me a lot

im getting this error, but the path is right


RE: RegRead Method help - KonstantinF - 02-03-2009

Code:
set WshShell = CreateObject("WScript.Shell")
KeyVal= WshShell.regread("HKEY_LOCAL_MACHINE\SOFTWARE\******-*****\DataDir\System")
Problem solved