PDA

View Full Version : Capture windows logon name


MAXIMUS
08-28-2002, 04:43 PM
Is it possible to capture the user's windows logon name via javascript or any web language. I know it can be done if you are running a program off your computer, but wanted to confirm that it cannot be read via the web.

beetle
08-28-2002, 06:48 PM
It can't be done with javascript. And even if it could be done with VBscript or java or whatever, the user would still mostly likely have to manually give the web-page access to the client machine.

nolachrymose
08-28-2002, 10:01 PM
You can use the WSH to get it:

if(typeof window.ActiveXObject != "undefined") {
var ws = new ActiveXObject("WScript.Network");
alert("Username: " + ws.UserName);
}

Hope that helps!

Happy coding! :)

beetle
08-28-2002, 10:17 PM
Heh. Every time I think that the client's machine is pretty much secure from a webpage, ol' ActiveX comes along and makes me look like an idiot :rolleyes: