WScript.Network Object
Description
The WScript.Network object provides access to Windows networking methods to easily control functions such as adding and displaying network shares and printers. It also exposes several networking properties including the current username, domain and computer name.
Example
'VBScript Example
Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "User Name: " & WshNetwork.UserName
WshNetwork.MapNetworkDrive "S:", "\\server\share"
'JScript Example
var WshNetwork = new ActiveXObject("WScript.Network");
WScript.Echo("User Name: " + WshNetwork.UserName);
WshNetwork.MapNetworkDrive ("S:", "\\server\share");















