<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Feb 23, 2016 at 9:34 PM Kenneth Lakin <<a href="mailto:kennethlakin@gmail.com">kennethlakin@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 02/23/2016 12:12 PM, Benoit Chesneau wrote:<br>
> I'm looking at the result of `inet:getifaddrs/0` and i'm not sure how to<br>
> use the interface name "//DEVICE/...". Is this a device id? Any idea how<br>
> i could query it using wmic?<br>
<br>
On my machine, the GUID part of the ifname (which is formatted as<br>
\\DEvICE\TCPIP_$GUID on my Windows 7 system) corresponds to the<br>
interface with the that GUID in the "SettingID" property of the "wmic<br>
nicconfig show" spew.<br>
<br>
I've never used wmic before, so I don't know how to get the nicconfig<br>
subcommand to only emit the information for a single interface, but<br>
maybe you do?<br>
<br></blockquote><div><br></div><div>This command will return the interface with the default gateway in a parsable way:</div><div><br></div><div>```</div><div><span style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px">C:\Users\benoitc> wmic nicconfig get SettingId,DefaultIPGateway /format:csv</span><br style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px"><br style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px"><span style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px">Node,DefaultIPGateway,SettingID</span><br style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px"><span style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px">DESKTOP-HV04GN1,,{F99FBC41-A2B8-4382-96C2-515CADD46DBF}</span><br style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px"><span style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px">DESKTOP-HV04GN1,{192.168.1.254;fe80::224:d4ff:fea6:1b91},{6C201F80-3E4C-4207-9607-2C82ABE771DE}</span><br style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px"><span style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px">DESKTOP-HV04GN1,,{D0A5BB3C-75DD-4224-9554-569137405B53}</span><br style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px"><span style="color:rgb(38,50,56);font-family:'Helvetica Neue',arial,sans-serif;font-size:13px;line-height:16px">DESKTOP-HV04GN1,,{58EB28CD-3B79-4A6A-A075-46577E343F83}</span><br></div><div>````
</div><div><br></div><div> now I could use the `where INDEX=X` condition if I am sure that `inet:getifaddrs/0` always return in the same order. Not sure yet how to filter using the SettingId...</div><div><br></div><div>- benoit</div></div></div>