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 bkrike 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 NT login name?

Status
Not open for further replies.

Petal

Programmer
Jun 8, 2001
56
NO
Hi

On our local intranet every pc use WIN 2000. Every user have a username and password they use to login.

I would like to make an .asp page that use the current users username on a sqlrequest to a database.

Do anybody know if this is possible, and how to do it?

Can I do it with javascript/jscript or asp?

Jørn Arild Andenæs
jaa@jaa.no
 
[VBScript]
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM")
WScript.Echo WshSysEnv("USERNAME")

[JScript]
var WshShell = WScript.CreateObject("WScript.Shell");
var WshSysEnv = WshShell.Environment("SYSTEM");
WScript.Echo(WshSysEnv("USERNAME"));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top