Skip to content

Instantly share code, notes, and snippets.

@Willshaw
Created March 22, 2020 19:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Willshaw/d7b94025f5359e8c344aa10c07b8b37a to your computer and use it in GitHub Desktop.
Save Willshaw/d7b94025f5359e8c344aa10c07b8b37a to your computer and use it in GitHub Desktop.
Quick batch file to disable/enable network adapter (mine is often slow on Windows 10 after waking from sleep)
@rem save this file somewhere, then create shortcut like this
@rem C:\Windows\System32\cmd.exe /c "C:\path\to\fixnetwork.bat"
netsh interface show interface
@echo on
@rem Disable the adapter - make sure the quoted name matches your adapter name
netsh interface set interface "INSERT NETWORK ADAPTER NAME HERE" DISABLED
@rem Wait 2 seconds before re-enabling (again adapter names must be correct)
timeout /t 2
netsh interface set interface "INSERT NETWORK ADAPTER NAME HERE" ENABLED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment