2

I'm looking for a way to, in a batch file, get a list of the components (such as NDIS drivers) in use by each network adapter on the system. Here's a screenshot of the info I want in the network adapter properties:

Screenshot of network adapter properties:

enter image description here

I have looked through a lot of the data I can get from WMIC, and while I can find a lot of network adapter information I'm not able to find exactly what I'm looking for.

Is anyone aware of a way to get this information from the regular Windows command line without using third-party utilities?

  • I would go the powershell route for the wide ranging configuration info you are looking for. netsh could likely get you close if the 'DOS' cmd line is a requirement, but for the level of integrated info you are looking for you are best off (imho) using the tool specifically designed for that type of task (disclaimer - not a huge fan of powershell): See blogs.technet.microsoft.com/wincat/2012/08/27/… – Argonauts Apr 30 '16 at 3:37
  • Unfortunately I am not familiar with PowerShell. I also can't be certain that users have it before they run the script, and I would like it to be dependency-free for simplicity. Also, I can't find any parameters for netsh that will display the information I am looking for. – GT500 Apr 30 '16 at 7:25
1

How do I get a list of the components used by each network adapter on the system.

You can use nvspbind (a Microsoft Technet application) to retrieve exactly the information you are asking for.

nvspbind is a tool for modifying network bindings from the command line. It is especially useful in Server Core environments with the Hyper-V role enabled.

...

There are three variations:

  • Microsoft_Nvspbind_package.EXE is the standard 64 bit version for server core.

  • 32bit_Nvspbind_package.EXE is a 32 bit version that works on Vista and newer.

  • XP_Nvspbind_package.EXE is a reduced functionality 32 bit version that works on XP and newer.

Source Hyper-V Network VSP Bind (nvspbind)

I've tested the Microsoft_Nvspbind_package.EXE version on Windows 7 64 bit with the following results:

F:\temp>nvspbind.exe "Local Area Connection 2" > lan2.txt

F:\temp>type lan2.txt

Hyper-V Network VSP Bind Application 6.1.7725.0.
Copyright (c) Microsoft Corporation. All rights reserved.


Adapters:

{37C93C8F-EE9C-4268-A33F-DD199D18748E}
"usb\class_e0&subclass_01&prot_03"
"Remote NDIS based Internet Sharing Device"
"Local Area Connection 2":
   enabled:  ms_netbios       (NetBIOS Interface)
   disabled: ms_server        (File and Printer Sharing for Microsoft Networks)
   enabled:  ms_pacer         (QoS Packet Scheduler)
   disabled: ms_ndiscap       (NDIS Capture LightWeight Filter)
   enabled:  ms_wfplwf        (WFP Lightweight Filter)
   enabled:  inspect          (COMODO Internet Security Firewall Driver)
   disabled: ms_msclient      (Client for Microsoft Networks)
   enabled:  ms_tcpip6        (Internet Protocol Version 6 (TCP/IPv6))
   enabled:  ms_netbt         (WINS Client(TCP/IP) Protocol)
   enabled:  ms_smb           (Microsoft NetbiosSmb)
   enabled:  ms_tcpip         (Internet Protocol Version 4 (TCP/IPv4))
   enabled:  ms_lltdio        (Link-Layer Topology Discovery Mapper I/O Driver)
   enabled:  ms_rspndr        (Link-Layer Topology Discovery Responder)
   enabled:  ms_pppoe         (Point to Point Protocol Over Ethernet)
   enabled:  ms_ndisuio       (NDIS Usermode I/O Protocol)

cleaning up...finished (0)

F:\temp>
  • nvspbind does look like the output would work for my purposes. Unfortunately it would require my batch file to have a dependency, and I don't want to have to ask users to install something before they run the batch file. – GT500 Apr 30 '16 at 10:15
  • @GT500 I don't think there is a "built-in" solution to achieve what you want :/ – DavidPostill Apr 30 '16 at 12:02
0

As an update, and to provide an example for anyone else who may need to know this, I wanted to post that I've found a way to take the suggestion given by DavidPostill by downloading NVSPBind with BITSAdmin (BITS Administration Utility). Apparently BITSAdmin was never removed from Windows (it is still in Windows 10, and still performs this function as expected).

I start by making a folder in %TEMP% to save the downloaded files in, sort of like this:

MD "%TEMP%\NVSPBind"

Some ECHO commands can go here to inform the user about the download, but we'll skip that in the example and go right to using BITSAdmin to download NVSPBind (note that the priority needs to be "foreground" in order for the download to run immediately):

BITSADMIN.EXE /TRANSFER "NVSPBind" /DOWNLOAD /PRIORITY FOREGROUND "https://gallery.technet.microsoft.com/Hyper-V-Network-VSP-Bind-cf937850/file/117119/1/32bit_Nvspbind_package.EXE" "%TEMP%\NVSPBind\32bit_Nvspbind_package.exe"

Next I have the batch file extract the NVSPBind files:

"%TEMP%\NVSPBind\32BIT_NVSPBIND_PACKAGE.EXE" /Q /T:"%TEMP%\NVSPBind"

Now we can run NVSPBind, and have it output a list of network adapters and installed components to our log (we'll assume the log is being saved to the user's Desktop):

"%TEMP%\NVSPBind\NVSPBIND.EXE" *>>%UserProfile%\Desktop\Diagnostic_Log.txt

Then, of course, I have the batch file clean up after itself and delete the TEMP folder we created and the NVSPBind files:

RD /S /Q "%TEMP%\NVSPBind"

Altogether the above code would look like this:

MD "%TEMP%\NVSPBind"
BITSADMIN.EXE /TRANSFER "NVSPBind" /DOWNLOAD /PRIORITY FOREGROUND "https://gallery.technet.microsoft.com/Hyper-V-Network-VSP-Bind-cf937850/file/117119/1/32bit_Nvspbind_package.EXE" "%TEMP%\NVSPBind\32bit_Nvspbind_package.exe"
"%TEMP%\NVSPBind\32BIT_NVSPBIND_PACKAGE.EXE" /Q /T:"%TEMP%\NVSPBind"
"%TEMP%\NVSPBind\NVSPBIND.EXE" *>>%UserProfile%\Desktop\Diagnostic_Log.txt
RD /S /Q "%TEMP%\NVSPBind"

The final log would look something like the following:

Hyper-V Network VSP Bind Application 6.1.7725.0.
Copyright (c) Microsoft Corporation. All rights reserved.


Adapters:

{9C5B16F9-78E6-4434-BE8E-81D6903EB907}
"*teredo"
"Teredo Tunneling Pseudo-Interface"
"Local Area Connection* 9":
   enabled:  ms_netbios       (NetBIOS Interface)
   enabled:  ms_server        (File and Printer Sharing for Microsoft Networks)
   enabled:  ms_msclient      (Client for Microsoft Networks)
   enabled:  ms_netbt         (WINS Client(TCP/IP) Protocol)
   enabled:  ms_smb           (Microsoft NetbiosSmb)
   enabled:  ms_tcpip6        (Internet Protocol Version 6 (TCP/IPv6))
   enabled:  ms_tcpip6_tunnel (Microsoft TCP/IP version 6 - Tunnels)

{F1C945CA-D4B9-4E09-90D1-66C5E85CC22E}
"*isatap"
"Microsoft ISATAP Adapter"
"isatap.{120652A1-8BD2-4435-BD9B-73B23DF7044B}":
   enabled:  ms_netbios       (NetBIOS Interface)
   enabled:  ms_server        (File and Printer Sharing for Microsoft Networks)
   enabled:  ms_msclient      (Client for Microsoft Networks)
   enabled:  ms_netbt         (WINS Client(TCP/IP) Protocol)
   enabled:  ms_smb           (Microsoft NetbiosSmb)
   enabled:  ms_tcpip6        (Internet Protocol Version 6 (TCP/IPv6))
   enabled:  ms_tcpip6_tunnel (Microsoft TCP/IP version 6 - Tunnels)

{120652A1-8BD2-4435-BD9B-73B23DF7044B}
"pci\ven_8086&dev_100f"
"Intel(R) PRO/1000 MT Network Connection"
"Local Area Connection":
   enabled:  ms_netbios       (NetBIOS Interface)
   enabled:  ms_server        (File and Printer Sharing for Microsoft Networks)
   enabled:  ms_pacer         (QoS Packet Scheduler)
   disabled: ms_ndiscap       (NDIS Capture LightWeight Filter)
   enabled:  ms_wfplwf        (WFP Lightweight Filter)
   enabled:  ms_msclient      (Client for Microsoft Networks)
   enabled:  ms_tcpip6        (Internet Protocol Version 6 (TCP/IPv6))
   enabled:  ms_netbt         (WINS Client(TCP/IP) Protocol)
   enabled:  ms_smb           (Microsoft NetbiosSmb)
   enabled:  ms_tcpip         (Internet Protocol Version 4 (TCP/IPv4))
   enabled:  ms_lltdio        (Link-Layer Topology Discovery Mapper I/O Driver)
   enabled:  ms_rspndr        (Link-Layer Topology Discovery Responder)
   enabled:  ms_pppoe         (Point to Point Protocol Over Ethernet)
   enabled:  ms_ndisuio       (NDIS Usermode I/O Protocol)

...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.