Last active
May 16, 2022 08:22
-
-
Save thewh1teagle/37686480e74268fa048db68328738629 to your computer and use it in GitHub Desktop.
This is a "patch" for strange bug of windows where you turn on your pc you have to reset network adapters to connect the internet
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
| @echo off | |
| :while_no_connection | |
| ping -n 1 8.8.8.8 | find "TTL=" >nul | |
| if errorlevel 1 ( | |
| goto reset_adapters | |
| ) else ( | |
| exit | |
| ) | |
| :reset_adapters | |
| for /F "skip=3 tokens=3*" %%G in ('netsh interface show interface') do ( | |
| netsh interface set interface name="%%H" admin="disabled" | |
| netsh interface set interface name="%%H" admin="enabled" | |
| ) | |
| timeout 5 | |
| goto while_no_connection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment