QTP Tip - READ Registry
Demonstrate Ability to Read Registry:
This snippet script should give you the OS and version. Just save the code fragment as "GetOS.vbs" on your disk where you can
easily get to it. Just double-click on the file name to execute it. You don't need QT
running. You can also copy this as-is into a new QTP Script and execute it.
Set WshShell = CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM")
strOS = WshSysEnv("OS")
strVersionNumber = WshShell.RegRead("HKLM\Software\Microsoft\" _
& "Windows NT\CurrentVersion\CurrentVersion")
strBuildNumber = WshShell.RegRead("HKLM\Software\Microsoft\" _
& "Windows NT\CurrentVersion\CurrentBuildNumber")
strActualOS = strOS & ", " & strVersionNumber & ", " & strBuildNumber
msgbox "OS and Version: " + strActualOS
The above is a mild variation of:
Note! The text at the above link talks about testing! Go figure!
[ 06-07-2003, 12:07 PM: Message edited by: jpensyl ]
Re: QTP Tip - READ Registry
Thanks for the tip, I've modified to get some of mercury's seeting out of the registry, and it's been off great help.