Batch script to automate resetting Wi-Fi in Win10
:GoTo TimeOut 1 PowerShell (Invoke-WebRequest -UseBasicParsing www.msftconnecttest.com/connecttest.txt).Content If %ErrorLevel%==0 GoTo GoTo netsh interface set interface Wi-Fi disabled netsh interface set interface Wi-Fi enabled TimeOut 5 GoTo GoTo When running a node or server sometimes a Wi-Fi adapter stops working, especially during IBD (Initial Block Download). Unfortunately some of us bought cheap Chinese imports which just won't die! I found a neat solution on the TenForums, but unfortunately it used too much CPU for some reason. BCHN IBD would have been nearly impossible without it, though. So today I wrote my own version which seems more efficient.
Could be useful if someone has a dodgy internet interface. Copy-paste the code into Notepad & save as MaintainInternetConnection.bat. Replace "Wi-Fi" with the name of the network connection. Then right-click & Run as Administrator.
It'd be faster to disconnect & connect, than disable & enable, but unfortunately I don't know simple code to do that. Maybe that'd require the Wi-Fi router's SSID. A standard OpenSSH connection doesn't survive, but there might be a way to better configure sshd.
[link] [comments]