Skip to content

Instantly share code, notes, and snippets.

@thewh1teagle
Last active May 16, 2022 08:22
Show Gist options
  • Select an option

  • Save thewh1teagle/37686480e74268fa048db68328738629 to your computer and use it in GitHub Desktop.

Select an option

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
@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