Arjen van Vliet said ... 1. use ipconfig (in DOS box) to obtain your ip address (in my case 172.16.38.124) ...
Is it that simple? Not really in my experience... The simple case scenario (IPv4): one network card = one IP and one gateway The worst case scenario (IPv4 or IPv6): +network cards = +IPs and +one or more gateways to deal with [it is becoming the normal scenario with Ethernet + WiFi + Bluetooth + VPN(s) + ...] After installing "Unix Utilities" (GnuWin32) into your Windows machine the command could be: C:\> ipconfig | grep IPv4 | awk "{print $NF}" This command could report one or more IP in the link-local range 169.254.0.0/16; these IP(s) could simply be discarded. The same approach should work for IPv6, remembering to discard those in the link-local range FE80::/10. C:\> ipconfig | grep IPv6 | awk "{print $NF}" A refined approach for IPv4 should consider in parallel with each IP(s) the default gateway associated to with command: C:\> ipconfig | grep Gateway | awk "{print $NF}" Only network card(s) associated with a real gateway are able to send net traffic to the outside world. Gateways AFAIK are automatic on IPv6. Which part of the "world" sits behind each gateway in a complex network, it could be difficult to recognize... Some of these rules should be applied also if Windows registry is inpected using $setting(). Hope it helps... Gianni
Author: gianni (
gianni.sandigliano@unifacesolutions.com)