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

Msgbox question 1

Status
Not open for further replies.

id10t

MIS
Feb 16, 2001
37
0
0
US
I have a script that has a message box pop up to show the user there Computer Name, Domain Name, and User Name.

Is there a way to have there IP show up as well?

This is what I have so far. Any other help would be greatly appreciated.

set wshnet = wscript.createobject("wscript.network")

text = "Networking Information" + vbcrlf + vbcrlf
Title = "Computer Info"

text = text + "Computer Name: " + wshnet.computername + vbcrlf + vbcrlf
text = text + "Domain Name: " + wshnet.userdomain + vbcrlf + vbcrlf
text = text + "User Name: " + wshnet.username + vbcrlf + vbcrlf

msgbox text, 64, title





Thanks again for the help!!!
 
The easiest implementation is to use the Winsock control:

On Error Resume Next
Set oWS = CreateObject("MSWinSock.WinSock")
If Err.Number = 0 Then
WScript.Echo oWS.LocalIP
Set oWS = Nothing
Else
WScript.Echo "Winsock not installed"
End If

BTW, love the handle. My end-users incur them ID10T errors daily. Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top