Retrieving Computer name using scripts (works on Remote system)
<form name="Master" method="post"
action=”">
<input type="label" name="TerminalId" value="S"
>Set
Sh = CreateObject(“WScript.Shell”)
sys =
Sh.ExpandEnvironmentStrings(“%CLIENTNAME%”)
User =
CreateObject(“WScript.Network”).Username
Server =
CreateObject(“WScript.Network”).computername
//MsgBox(user & ” ” &
sys & ” to ” & server)
//Wscript.Echo “Logon By ” & User & “
from ” & sys & ” On to ” & Server<script
type=”text/javascript”>
var network = new
ActiveXObject(“WScript.Network”);document.Master.TerminalId.value = network.ComputerName + “.” +
network.UserDomain;
//alert(network.ClientName);
//alert(sys);//var
sh = new ActiveXObject(“WScript.Shell”)
//var sys =
sh.ExpandEnvironmentStrings(“%CLIENTNAME%”)
//alert(sh.clientAddress);//var
WTS = new ActiveXObject(“WTSManager.Shell”)
//alert(WTS.MyClientName + ” My
IP address: ” + WTS.MyIPAddress);
if(sys == ‘%CLIENTNAME%’)
sys =
network.ComputerName;
if(Server == sys)
Server =
network.UserDomain;<script
type=”text/javascript”>
alert(sys + ” – ” + server + ‘ – ‘ +
network.UserDomain);The script will fetch the parameter from the ysstem variable and extract the computer name logged in or the current one.
Posted in Windows
This was originally posted here.

Like
Report
*This post is locked for comments