Created
June 23, 2022 07:17
-
-
Save incyi/672e322b36e1ca434b81c892221ee362 to your computer and use it in GitHub Desktop.
Turn off ethernet and turn on again with Windows 10 batch file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: | |
:: 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