日期:2013-07-12  浏览次数:20904 次

//************************************************
// File:    Network.js (WSH sample in JScript)
// Author:  (c) G. Born
//
// Showing the user name, domain name, and
// workgroup name
//************************************************

var Text = "Networking information\n\n";

// Create WshNetwork object to access network properties.
var WshNetwork = WScript.CreateObject("WScript.Network");

Text = Text + "Computer name : " + WshNetwork.ComputerName + "\n";
Text = Text + "Domain : " + WshNetwork.UserDomain + "\n";
Text = Text + "User name : " + WshNetwork.UserName + "\n";

WScript.Echo(Text);

//*** End