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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get an enviroment variable in client side

Status
Not open for further replies.

heberson

IS-IT--Management
Sep 16, 2002
22
BR
Hello

I am a newbie and need the words from experts.


How can I get a enviroment variable from a client side?

My users have windows 98 and Xp and will acess my asp pages.

I do not have AD implemented and I need to know how can I get a variable called NWUSERNAME that is configured by Novell Client.

So If I have one way to do this I can obtain the name of users which are acessing my pages.


Thanks for any information.

Héberson Sette de Almeida
rstti@brfree.com.br
C.U.E. Certified Unicenter Engineer
I.C.Q. 2772167
 
Something like this?
Code:
<HTML>
<HEAD>
<TITLE>Who Am I</TITLE>
</HEAD>
<BODY>
<script language="vbscript">
dim dos, env
set dos = CreateObject ("WScript.Shell")
set wshsys = dos.Environment ("PROCESS")
whoami = wshsys("USERNAME")
document.write "User is " & whoami
</script>
</BODY>
</HTML>
 
Look up help pages on WSHEnvironment. It depends on whether NWUSERNAME is stored under SYSTEM, USER, VOLATILE or PROCESS. You have to look up the relevant group to find your environment variable.
 
heberson, you could use ActiveX to access the client PC to determine the environment variables but this will be an IE only method and it will trigger ActiveX alerts for the client requiring them to allow the code to execute.

Other than having a custom written control that is uploaded to all the client PCs ActiveX is the only way I think you are going to get this to work and it has it's drawbacks.


At my age I still learn something new every day, but I forget two others.
 
Hi

I have to run this code inside ASP page, so asp must be the extension of the file, right?

I found in registry that the variable is in the Volatile Enviroment so How can I do this?

Héberson Sette de Almeida
rstti@brfree.com.br
C.U.E. Certified Unicenter Engineer
I.C.Q. 2772167
 
This is a security issue. A web server should not be able to discover more about the browser client than the client chooses to reveal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top