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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi Is it possible to display the

Status
Not open for further replies.

Easchurch

Technical User
Jan 8, 2003
1
GB
Hi
Is it possible to display the machine name
and logged in user name on a html document
ie %User% %computername%
like you can in a batch file

the document would be used localy
 
do it this way :
Code:
<Script language=&quot;VBScript&quot;>
  function getUserAndComputer()
    Dim WshNetwork 
    Set WshNetwork = WScript.CreateObject(&quot;WScript.Network&quot;)
    Msgbox &quot;Domain = &quot; & WshNetwork.UserDomain
    Msgbox &quot;Computer Name = &quot; & WshNetwork.ComputerName
    Msgbox &quot;User Name = &quot; & WshNetwork.UserName
  End function
</Script>

Note: in order for this script to run properly, you must set ActiveX security options to &quot;allowed&quot; in IE security. Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top