0

Hi,
i have written a code for getting the environmental variable.I am getting the error as wscript undefined.

<html>
<head>
<title>Test</title>
<script language="javascript">
function getEnvironment() {
	var shell = WScript.CreateObject("WScript.Shell");
 	var env = shell.Environment("USER"); 
	alert(env("temp"));
}
</script>
</head>
<body>
<button onclick="javascript:getEnvironment();">Click</button>
</body>
</html>
4
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by hljmdjrs
0

Please note that this will not work on many OSes (mainly Unix-based such as Mac and Linux). I think the only supporting browser is Internet Explorer for Windows, since WScript can only be accessed through ActiveX. The only possible reason you might want to use this is if you're not developing for the web.

Anyways, here is your answer.

0

What browser and system are you on?

mozillafirefox browser and OS xp

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.