Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Basically, if you go to Start and click Computer and then click on the Network link on the left hand side, you'll notice on the right hand side several categories, one of which is titled "Network Infrustructure", in that category, my router is listed, and in my case, it is "LINKSYS WAG160N Wireless-N ADSL2+ Gateway" and when you right-click and select properties, it lists basic info such as internal/gateway IP address, on mine it is ""

I would like to know how to retreive this information in ie: either registry location or Windows API call or .net framework reference etc, preferably a Windows API or Registry Location so that i can call it using a legacy VB6 app but anything will do at the moment as i am totally lost in this respect.

thanks guys :)

share|improve this question

You could easily get all the information you need using WMI Network classes.
For a simple .Net code with a full implementation, look here.

share|improve this answer
thanks for the info, but this just shows the details for my local/client wireless 802.11n wifi card on my computer, this doesn't list or show the actual router, which would be the linksys, i checked through the enumeration. – user55887 Oct 1 '10 at 20:11
Try one of the other WMI classes then. You can still use the code to run through the enumeration – Traveling Tech Guy Oct 1 '10 at 23:14
which WMI class do you think it is likely to be? i'm at a stumbling block! – user55887 Oct 13 '10 at 1:36

Did you ask this at SO? You can parse the output of the "route print -4" to get the default gateway.

share|improve this answer
hi dbasnett, i'm trying to get the name of the router that is tied to the particular default gateway/router ip as is shown through the method described above, do you know how to do this? thanks. – user55887 Oct 13 '10 at 1:38
up vote 0 down vote accepted

I got the answer from a superuser post and here is the link...

basically, turns out you need to look into the upnp.dll insite windows\system32 and learn how to use it by looking up references for the upnp api on msdn! this is how you get the details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.