Show/Hide Toolbars

EmEditor Help

Navigation: EmEditor Help > Macro Reference > Tutorial

EmEditor Macro Reference: Get the Name of a Computer User

Scroll Prev Top Next More
EmEditor Home - EmEditor Help - EmEditor Macro Reference - Tutorial

Get the Name of a Computer User

To get the name of a computer user, use the UserName Property of WshNetwork Object.

The following example demonstrates how to get the name of a current computer user:

[JavaScript]

WshNetwork = new ActiveXObject( "WScript.Network" );

alert( "User Name = " + WshNetwork.UserName );

[VBScript]

Set WshNetwork = CreateObject( "WScript.Network" )

alert "User Name = " & WshNetwork.UserName

References

g Microsoft MSDN Library: UserName Property

Copyright © 2003-2016 by Emurasoft, Inc.