Il codice che hai postato, se avesse i permessi di esecuzione, segnalerebbe i dati della macchina su cui e' eseguito, ovvero il server, e non quelli dell'utente.
Prova questo:
codice:
NomeMacchina = ""
On Error Resume Next
ip = Request.ServerVariables("REMOTE_ADDR")
Set Shell = Server.CreateObject("Wscript.Shell")
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
Path = Server.MapPath("/public/Logs/") & "\" & Session.SessionID & ".txt"
Shell.run "%comspec% /c tracert " & ip & " > " & Path ,0 , True
' a seconda del sistema operativo del server usare questa:
' Shell.run "%comspec% /c nslookup " & ip & " > " & Path ,0 , True
set f = Fso.OpenTextFile(Path)
' Rilevazione instradamento
While not f.AtEndOfStream
Riga = f.Readline
If InStr(Riga,"[")>0 then
r = InStr(Riga,"[")
l = InStrRev(Riga, " ", r-2)
NomeMacchina = Mid(Riga,l+1,r-l-2)
' NomeMacchina = Replace(NomeMacchina,Chr(13)&Chr(10),"")
end if
Wend
set f = Nothing
Fso.DeleteFile Path
Set Fso = Nothing
ciao
ps: per il nome utente, se non si e' autenticato sul server, la vedo proprio brutta... sarebbe una palese violazione della privacy se fosse possibile