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!

DIsplay TCP/IP Settings via GUI 5

Status
Not open for further replies.

joem28a

Technical User
Oct 15, 2002
26
0
0
AU
Hi folks,

I am looking for some code to simply display the TCP/IP Settings via XP desktop; nothing fancy, just a simple display of the IP Address settings. Once displayed, the User can just click on an "Exit" button. Hope someone can assist. Many thanks.

Regards,
Joe28a
 
Everest home edition at lavalys.hu will do that among many other things.

I tried to remain child-like, all I acheived was childish.
 
Not sure if it's exactly what you want, but there is a handly little app called "bginfo" available from which adds such information to the desktop background.

Failing that, you could always right click on the network connection icon, go to status and then the "support" tab.

Two possible solutions, although not exactly what you are after. I'm sure there will be some code available though.

Perhaps a batch file that echos the output?
 
Hi Jimbopalmer / Cyberspace,

Many thanks for your suggestions. I actually saw bginfo one day after I posted my request; very useful information; especially from a support persepective. Take care.

Regards,
Joem28a
 
Hi PalmTest,

Very interesting tool indeed; thank you for that.
 
I would also have a look at this script.

************************************************************
strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colAdapters = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

n = 1

For Each objAdapter in colAdapters
WScript.Echo "Network Adapter " & n
WScript.Echo " Host name: " & objAdapter.DNSHostName

If Not IsNull(objAdapter.IPAddress) Then
For i = 0 To UBound(objAdapter.IPAddress)
WScript.Echo " IP address: " & objAdapter.IPAddress(i)
Next
End If

If Not IsNull(objAdapter.IPSubnet) Then
For i = 0 To UBound(objAdapter.IPSubnet)
WScript.Echo " Subnet: " & objAdapter.IPSubnet(i)
Next
End If

n = n + 1

Next

Function WMIDateStringToDate(utcDate)
WMIDateStringToDate = CDate(Mid(utcDate, 5, 2) & "/" & _
Mid(utcDate, 7, 2) & "/" & _
Left(utcDate, 4) & " " & _
Mid (utcDate, 9, 2) & ":" & _
Mid(utcDate, 11, 2) & ":" & _
Mid(utcDate, 13, 2))
End Function
************************************************************

Take the *'s away and save it as a vbs file and it should do the job as well.

SimonD.

The real world is not about exam scores, it's about ability.

 
Great script that Simon!

I am editing it for my own benefit and I am trying to add the default gateway to the output.

I have tried:

If Not IsNull(objAdapter.IPDefaultGateway) Then
For i = 0 To UBound(objAdapter.IPDefaultGateway)
WScript.Echo " Default Gateway: " & objAdapter.IPDefaultGateway(i)
Next
End If

Also tried just "IPGateway" - I am however just trying to guess the object name by trying the obvious. What is the actual name?

Thanks.
 
I will get the gateway info for you tomorrow, am at home atm.

SimonD.

The real world is not about exam scores, it's about ability.

 
try adding in.

If Not IsNull(objAdapter.DefaultIPGateway) Then
For i = 0 To UBound(objAdapter.DefaultIPGateway)
WScript.Echo " Default gateway: " & _
objAdapter.DefaultIPGateway(i)
Next
End If



SimonD.

The real world is not about exam scores, it's about ability.

 
It works, thats great thanks!

Can you tell me what this code section is for please?

Function WMIDateStringToDate(utcDate)
WMIDateStringToDate = CDate(Mid(utcDate, 5, 2) & "/" & _
Mid(utcDate, 7, 2) & "/" & _
Left(utcDate, 4) & " " & _
Mid (utcDate, 9, 2) & ":" & _
Mid(utcDate, 11, 2) & ":" & _
Mid(utcDate, 13, 2))
 
Unfortunately no, it's not my script.

I will see if I can find out for you.

SimonD.

The real world is not about exam scores, it's about ability.

 
Oh ok, thats no matter, was just curious, as it does not work without that segment and I was just trying to figure out what it actually did!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top