Danbabe
01-10-2006, 08:48 PM
When logging onto a network, a username is stored and can be pulled up in a batch file - "echo %username%".
In an ASP page, I need to get that network username. I do not wat to have to get them to log in at all, I just need the network username.
I have tried writing a batch file which works and getting ASP to call the batch file and write the response from the .bat:
''''''''''''''''''''''''''''''''
Dim fs, f, user
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile("D:\Home\Default\domain.co.uk\htdocs\BDi2\Username.bat")
set resp = f.Response
set f = nothing
set fs = nothing
''''''''''''''''''''''''''''''''
before I even write the line response.write(resp), the code falls over with .Response not supported.
Does anyone know how I can get the users network username when they logged on to the Windows network?
Thanks yol
Dan
In an ASP page, I need to get that network username. I do not wat to have to get them to log in at all, I just need the network username.
I have tried writing a batch file which works and getting ASP to call the batch file and write the response from the .bat:
''''''''''''''''''''''''''''''''
Dim fs, f, user
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile("D:\Home\Default\domain.co.uk\htdocs\BDi2\Username.bat")
set resp = f.Response
set f = nothing
set fs = nothing
''''''''''''''''''''''''''''''''
before I even write the line response.write(resp), the code falls over with .Response not supported.
Does anyone know how I can get the users network username when they logged on to the Windows network?
Thanks yol
Dan