Question:
How can I retrieve the name of the computer running the application, at runtime?
Solution:
To do so, you must use the following script:
Set WshNetwork = CreateObject(“WScript.Network”)
MsgBox WshNetwork.ComputerName
‘MsgBox WshNetwork.UserDomain
‘MsgBox WshNetwork.UserName
With this script, you can also get the name of the user logged in, as well as the Domain where they are logged to.
NOTE: with version 3.5 or higher, you can also use E3Globals‘s GetComputerName() method, which performs this exact same task.
Example: MsgBox GetComputerName()