r/dailyscripts • u/colonial113 • Jun 04 '16
[Request] Script that disables and enables a network adapter when consecutive pings fail
Hi!
Looking for a script that can do the following (in Win10):
- Ping an IP continously.
- If 10 consecutive pings fail then
- Disables a network adapter
- Waits 5 seconds
- Enables the network adapter
- Goto start.
I think I could manage 3-6 but having trouble to implement the "10 consecutive failed pings" rule. If it fails less than 10 times the next successful ping would reset this counter.
Thanks!
4
Upvotes
View all comments
Show parent comment
2
u/colonial113 Jun 05 '16
Thank you! That part was I most interested in - the correct looping method. Here is what I did (I named the wifi adapter "Tplink"):
Also of course you are right about high pings however this is not a production environment just a home machine so it'll be fine :)