How to determine if a pc is on the same lan...

  • Thread starter Thread starter Terry Olsen
  • Start date Start date
T

Terry Olsen

I'm backing up pc's across the lan (My Documents folders). A lot of
these pc's are laptops which may travel. They are still on the intranet,
but in a different building so the speed is tremendously slower. I
think the best way is to check that the default gateway is the same as
the machine doing the backup.

So how can I check the local/remote default gateway IP address? (aside
from calling IP config and parsing the return?)

Thanks.
 
In vb6 i'd do this:

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery ("Select * from
Win32_NetworkAdapterConfiguration " & "where IPEnabled=TRUE")

For Each objAdapter In colNetAdapters
etc
Next

objAdapter contains the information you need.

Good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top