Command Line How-To

Batch file to disable and re-enable your NIC.

Today I was remoted into a machine where I needed to disable / re-enable the NIC.  Problem was that this particular machine was located in a different time zone all together.  I created a batch file that would accomplish this task (of course, I tested on my workstation prior to trying it on a machine I don’t have physical access to.  This did the trick right away.

You may need to first find out what your NIC is called either via the command line:


Or from the adapters control panel page for a GUI.

@echo on
timeout /t 5
netsh interface set interface "Ethernet" DISABLED
timeout /t 5
netsh interface set interface "Ethernet" ENABLED
Travis Wade
Travis Wade
Just a normal human being living the dream. I'm an IT professional in the Healthcare space with a love and passion for cloud computing and highly redundant infrastructure.

Leave a Reply

Your email address will not be published. Required fields are marked *