Link to home
Start Free TrialLog in
Avatar of samme
sammeFlag for United States of America

asked on

retrieve computer name with javascript

I have stand alone app and am trying to retrieve the computer name in order to use in the creation of a text file name.  Can someone tell me why this code gives me the error "WScript not defined"?  Thank you in advance!

<script language="JavaScript" type="text/javascript">
var strComputer
{
var WshNetwork = WScript.CreateObject("WScript.Network");
strComputer = WshNetwork.ComputerName;
}

alert(strComputer)
</script>
ASKER CERTIFIED SOLUTION
Avatar of dswisstack
dswisstack

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of samme

ASKER

Thanks for the quick response and you're right.. I changed the code and it works fine!  Thanks again!  

sam