Link to home
Start Free TrialLog in
Avatar of DugAdmin
DugAdmin

asked on

Write Windows Username Into Input Field - Important

I need a javascript or VB code to display the visitors windows username in a input field as a default value.

I was wondering if this little VB script might help:
      <script language="VBScript">
         Set WshNetwork = WScript.CreateObject("WScript.Network")
         WScript.Echo "Domain = " & WshNetwork.UserDomain
         WScript.Echo "Computer Name = " & WshNetwork.ComputerName
         WScript.Echo "User Name = " & WshNetwork.UserName
      </script>

Is there some way to display WshNetwork.UserName as a value in an input?

Thanks

DugAdmin
Avatar of JamesSmithIsTaken
JamesSmithIsTaken

maybe this is what you're looking for?

<input type="text" value=<%=Environ("UserName")%> name="username">
Avatar of DugAdmin

ASKER

Thanks for your reply, ill get back to you if it works
Sorry, the code didn't seem to work
ASKER CERTIFIED SOLUTION
Avatar of JeremyCS
JeremyCS

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial