Enabling and disabling NICs from commandline in Windows
Every so often, someone asks the question: how do I use NETSH to disable a NIC? And the answer is: NETSH cannot disable a NIC.
So here’s how you disable a NIC from the commandline in Windows. The secret is WMIC!
- To see any step, move the video slider to that timestamp.
- You can pause there or watch video.
- Go fullscreen for greater detail; remove captions if they obscure something.
- Still confused? Go here for a better explanation.
- 0:05 Get a list of NICs and their index numbers with the command: wmic nic get name, index
- 0:16 We'll disable the Intel Gigabit NIC, (index number 7). In the upper window, it's presently enabled but disconnected.
- 0:25 The disable command is: wmic path win32_networkadapter where index=7 call disable
- 0:47 Notice that in the upper window, the Gigabit NIC immediately changes to "Disabled"
- 0:55 Re-enabling now with: wmic path win32_networkadapter where index=7 call enable
- 1:02 And we see the NIC enabled again (still disconnected).
- 1:11 That's all, folks!