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 | |
by afoken (Chancellor) on Nov 08, 2023 at 19:03 UTC | |
by Bod (Parson) on Nov 08, 2023 at 18:06 UTC |