in reply to parsing windows ipconfig /all

What have you tried?

I've never had need to parse the output other than with my eyes but it doesn't sound especially difficult. Here is a sample output from my office desktop...

C:\Users\user\Perl>ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : Lets-Delight-Office Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : lan Wireless LAN adapter WiFi 2: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Realtek RTL8192EU Wireless LAN +802.11n USB 2.0 Network Adapter Physical Address. . . . . . . . . : 1C-BF-CE-87-64-C2 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Wireless LAN adapter Local Area Connection* 11: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual +Adapter #3 Physical Address. . . . . . . . . : 1E-BF-CE-87-64-C2 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Wireless LAN adapter Local Area Connection* 12: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual +Adapter #4 Physical Address. . . . . . . . . : 1C-BF-CE-87-64-C2 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Ethernet adapter Ethernet 2: Connection-specific DNS Suffix . : lan Description . . . . . . . . . . . : Intel(R) Ethernet Connection I2 +17-LM Physical Address. . . . . . . . . : 98-90-96-C9-54-D5 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::dbac:863b:bb80:c775%21(Pr +eferred) IPv4 Address. . . . . . . . . . . : 192.168.1.232(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Lease Obtained. . . . . . . . . . : 08 November 2023 10:41:58 Lease Expires . . . . . . . . . . : 08 November 2023 22:41:59 Default Gateway . . . . . . . . . : 192.168.1.1 DHCP Server . . . . . . . . . . . : 192.168.1.1 DHCPv6 IAID . . . . . . . . . . . : 261656726 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-27-A4-98-23-00-19-9 +9-EB-E2-1E DNS Servers . . . . . . . . . . . : 192.168.1.1 NetBIOS over Tcpip. . . . . . . . : Enabled C:\Users\user\Perl>

Splitting each line by ' : ' then removing the full stops from the and of the first part and the line break from the end of the second part and you should be done.

Replies are listed 'Best First'.
Re^2: parsing windows ipconfig /all
by afoken (Chancellor) on Nov 08, 2023 at 16:33 UTC

    Also note that the output of ipconfig is translated from English to what Microsoft thinks(*) is the local language. Good look getting that to work on all non-english versions.


    (*) Perhaps one should register a new IETF language tag de-MI (German as translated by Microsoft) in addition to de-DE, de-AT, de-CH, given the significant differencess to de-DE, de-AT, and de-CH. ;-)

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
      Also note that the output of ipconfig is translated from English...

      As an Englishman, I've never had the pleasure(!?!) of digging into a non-English version of Windows. Many years ago, before the days of roaming on my mobile, I used Turkish versions during regular visits to Istanbul in internet cafes and side rooms off hotel lobbies. That was quite instructive for improving my Turkish as I recognised the location of the buttons and menu items but had to translate them for them to be useful.