Provides access to the shared resources on the network to which your computer is connected.
Remarks
Example
The following example demonstrates displaying the domain name, computer name, and user name for the current computer system using the WshNetwork object.
| Copy Code |
---|
<package>
<job id="vbs">
<script language="VBScript">
Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "Domain = " & WshNetwork.UserDomain
WScript.Echo "Computer Name = " & WshNetwork.ComputerName
WScript.Echo "User Name = " & WshNetwork.UserName
</script>
</job>
<job id="js">
<script language="JScript">
var WshNetwork = WScript.CreateObject("WScript.Network");
WScript.Echo("Domain = " + WshNetwork.UserDomain);
WScript.Echo("Computer Name = " + WshNetwork.ComputerName);
WScript.Echo("User Name = " + WshNetwork.UserName);
</script>
</job>
</package> |
Properties
Methods
See Also