Skip to content

Instantly share code, notes, and snippets.

@incyi
Created June 23, 2022 07:17
Show Gist options
  • Save incyi/672e322b36e1ca434b81c892221ee362 to your computer and use it in GitHub Desktop.
Save incyi/672e322b36e1ca434b81c892221ee362 to your computer and use it in GitHub Desktop.
Turn off ethernet and turn on again with Windows 10 batch file
::
:: Turn on/off Ethernet
:: Tested on Windows 10 professional
:: Right click on the bat file and press on Run as administrator
::
@echo on
:: Turn off "Ethernet 1", this should be the device name as in your Network Connections.
netsh interface set interface "Ethernet 1" DISABLED
:: Wait some time
timeout /t 3
:: Turn on "Ethernet 1", this should be the device name as in your Network Connections.
netsh interface set interface "Ethernet 1" ENABLED
:: Wait some time
timeout /t 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment