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 gkittelson 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 get the Windows Environment variables?

Status
Not open for further replies.

MB20

Technical User
Nov 10, 2002
1
AT
Hello,

I need in my HTML-Page a VBScript that read the Windows environment variables.

Can somebody help me please?

best regards
martin
 
This will display the temp variable from the environment for user and system


<html>
<head>
<title>Post</title>
<SCRIPT LANGUAGE=&quot;vbscript&quot;>

Sub changecolor
Dim objshell
set objshell = CreateObject(&quot;Wscript.Shell&quot;)
Document.Write &quot;Temp Variable for user : &quot; & objshell.ExpandEnvironmentStrings(objshell.Environment(&quot;User&quot;)(&quot;Temp&quot;))
Document.Write &quot;<BR><BR>&quot;
Document.Write &quot;Temp Variable for system : &quot; & objshell.ExpandEnvironmentStrings(objshell.Environment(&quot;System&quot;)(&quot;Temp&quot;))

end sub
</Script>

</head>
<body>
<body topmargin=&quot;0&quot; leftmargin=&quot;0&quot; bgcolor=&quot;white&quot; OnLoad=&quot;changecolor&quot;>
&quot;This is a test message&quot;
</Body>
</head>
</HTML> Regards
Steve Friday
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top