codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Environment variables  Archive Import (packermann) at 12:03 on Thursday, June 26, 2003
 

I need to retrieve the environment variables from the client using Java or Javascript. Can anyone help?

  Re: Environment variables  Troy Wolf at 16:03 on Wednesday, July 16, 2003
 

I know you said Java or Javascript, but I thought I`d pass this along just in case it helps you find a javascript equivalent. Here is how to retreive the client`s environment variables using client-side VBScript in an HTML page. (Note: if you run this, your browser may warn you that an ActiveX script is trying to run and ask you to OK it.)

<html>
<script language=vbscript>
Set Shell = CreateObject("WScript.Shell")
CompName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")
alert(CompName)
</script>
</html>
Troy Wolf: site expert
SnippetEdit Website Editor


  Re: Environment variables  li_xiao_long at 11:58 on Monday, September 08, 2003
 

Is there any method to find out the users' domain name and or work group too?

The reason I ask is that im trying to create a form which users will post their name and address details, but at the same time will also log their machine name, work group (if applicable), and domain name.

Also, if by using the method that you've described already can be written to a variable rather than displayed on screen, can that variable then be used in asp (since i notice its vb script)?



  Re: Environment variables  li_xiao_long at 15:59 on Tuesday, September 09, 2003
 

Thank you very much for your time and effort to post that code - it has come in _very_ useful!

I was beginning to think asp couldnt do what I was asking it to do...

Thank again!

Chris









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  What is the important of coding standard?
•  How to use two sorting methods for a product list?
•  www.Echeapjackets4moncler.com
•  What is the important of PHP include file?
•  What is JAVA socket?
•  What is the important of AJAX tools?
•  What is ASP.net life cycle?
•  Documentation Script (fixed)
•  Documentation Script


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2012