Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I obtain O/S variable information?

Status
Not open for further replies.

ringd

Programmer
Jul 11, 2000
35
GB
Hello!

How can I access local system / dos / user / environment variables using JavaScript, running in a Windows NT environment?

Cheers,
Dave.
mailto:dave.ring@barclays.co.uk
 
If you're running the script inside a browser, I'm not aware that you can - there are so many restrictions imposed in this context (for good reason) that there's very little that you can usefully do.

OTOH if you're running under the Windows Scripting Host, or in an HTA, you can use the ExpandEnvironmentStrings of the WSH shell:

WshShell = WScript.CreateObject("WScript.Shell");
temp = WshShell.ExpandEnvironmentStrings("%TEMP%");




Keith Trangmar
Harlend Computer Services
Maidstone, Kent. UK.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top