0

我正在尝试获取特定接口的 ipconfig /all 中存在的所有数据。

我不能使用 netssh 或任何其他程序。

我可以使用 grep(对于 windows - 但只能使用 grep,而不是 mgrep pcgrep 或其他)、sed(同样的东西..)或 findstr。

大家能想出办法吗?

我想获取“SLOT 2 3”的所有数据并释放所有其他数据。

这是输出的样子:

Windows IP 配置

   Host Name . . . . . . . . . . . . : l-075
   Primary Dns Suffix  . . . . . . . : 
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : wininstall.what.com

以太网适配器插槽 2 3:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Ethernet Adapter
   Physical Address. . . . . . . . . : 00-02-C9-B5-94-E1
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::202:c9ff:feb5:94e1%24(Preferred)
   IPv4 Address. . . . . . . . . . . : 12.0.0.33(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Lease Obtained. . . . . . . . . . : Thursday, January 2, 2014 12:26:18 PM
   Lease Expires . . . . . . . . . . : Friday, January 10, 2014 12:26:18 PM
   Default Gateway . . . . . . . . . :
   DHCP Server . . . . . . . . . . . : 12.0.0.83
   DHCPv6 IAID . . . . . . . . . . . : 436208329
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-25-9E-19-D4-AE-52-A1-37-E7
   DNS Servers . . . . . . . . . . . : 10.4.0.0
                                       10.4.0.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

以太网适配器插槽 2 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Ethernet Adapter #2
   Physical Address. . . . . . . . . : 00-02-C9-B5-94-E0
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

以太网适配器 NIC4:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Broadcom NetXtreme Gigabit Ethernet #4
   Physical Address. . . . . . . . . : D4-AE-52-A1-37-EA
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

这就是我需要的:

以太网适配器插槽 2 3:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Ethernet Adapter
   Physical Address. . . . . . . . . : 00-02-C9-B5-94-E1
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::202:c9ff:feb5:94e1%24(Preferred)
   IPv4 Address. . . . . . . . . . . : 12.0.0.33(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Lease Obtained. . . . . . . . . . : Thursday, January 2, 2014 12:26:18 PM
   Lease Expires . . . . . . . . . . : Friday, January 10, 2014 12:26:18 PM
   Default Gateway . . . . . . . . . :
   DHCP Server . . . . . . . . . . . : 12.0.0.83
   DHCPv6 IAID . . . . . . . . . . . : 436208329
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-25-9E-19-D4-AE-52-A1-37-E7
   DNS Servers . . . . . . . . . . . : 10.4.0.0
                                       10.4.0.1
   NetBIOS over Tcpip. . . . . . . . : Enabled
4

0 回答 0