• Welcome to Theos PowerBasic Museum 2017.

IWshNetwork.UserDomain Property

Started by José Roca, July 14, 2008, 08:12:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following example demonstrates the use of the UserDomain property:

JScript


var WshNetwork = WScript.CreateObject("WScript.Network");
WScript.Echo("Domain = " + WshNetwork.UserDomain);
WScript.Echo("Computer Name = " + WshNetwork.ComputerName);
WScript.Echo("User Name = " + WshNetwork.UserName);


VBScript


Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "Domain = " & WshNetwork.UserDomain
WScript.Echo "Computer Name = " & WshNetwork.ComputerName
WScript.Echo "User Name = " & WshNetwork.UserName


PowerBASIC


DIM pWshNet AS IWshNetwork
pWshNet = NEWCOM "WScript.Network"
PRINT "User name: " & ACODE$(pWshNet.UserName)
PRINT "User domain: " & ACODE$(pWshNet.UserDomain)
PRINT "Computer name: " & ACODE$(pWshNet.ComputerName)