Pages

Wednesday, 19 October 2011

QTP Script: Get system information like User Name and Computer Name


Dim objNet

' create a network object
Set objNet = CreateObject("WScript.NetWork")

' show the user name
MsgBox "User Name: " & objNet.UserName 

' show the computer name
MsgBox "Computer Name: " & objNet.ComputerName 

' show the domain name
MsgBox "Domain Name: " & objNet.UserDomain

' destroy the object
Set objNet = Nothing 


0 comments:

Post a Comment