Question Locked

How do I query XP system to see if it is connected to network?

0 helpful
14 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We are trying to write a procedure so if the network cable is not connected to the pc, it throws an error message saying to plug in NIC cable. I have unsuccessfully tried looking thru MS stuff and Googled different things but am still at a loss. I would like to use a command line to poke for the current status of the lan connection. Is there any hope for this?

Thanks in advance!
Dave

14 replies

by Former member

I believe XP even pops up a message saying the cable is unplugged...

by dumphrey

you should get an event id 4202 in your system event log. This can be used for an eventrigger.

If the computer is on a domain (may work with a workgroup) the net view command will return a System Error 1231 if the net cable is disconnected.

Then there is always the classic ping, pathping, or tracert.

by summersond

What we are attempting to do is to discover if the pc is not yet plugged into the network upon first setting up the pc. We have it run the initial (sysprepped) setup to get to windows, reboot, then it comes to our corporate setup menu that automates the final install for the user. It is here that we need to make sure that the lan cable is plugged in before they attempt to run the script, so this is where I need some kind of check to keep them from continuing until the cable is plugged in. Clear as mud? :)

thanks!
dave

by Former member

You could do a script that pings the gateway and if no response, do something else, like send a message.

by summersond

We want it to be totally transparent to the user so there is no interaction from them. They tend to really screw things up... :)

by summersond

If there is a way to ping the server and grab an error code to use, that would work.

by summersond

... except I dont know how to script. :( I cant think it would be too hard to write if one had the scripting knowledge.

Thanks!

by summersond

We found a command that will work great. We are using findstr command. It will look at the text log of the results of the ping command and search for any string within that file that we wish. If it does not find it, then it will return one error code. If it does find it, it will return another and with these, we can now branch to whatever action we choose.
Thanks all for your input! It has helped greatly.

Dave

by Former member

How's Johnston? You realize I'm just a couple miles from you, in Ankeny? :p

This discussion is closed to new replies.