Script to reboot when no Internet Connection?

from time to time my Windows 10 Laptop is unable to connect to the wireless network. The only solution is to reboot the LapTop when this happens... The best idea I've come up with is to schedule a task to run a script when the computer starts to check if there is a connection to the internet, (maybe pinging... show more from time to time my Windows 10 Laptop is unable to connect to the wireless network.

The only solution is to reboot the LapTop when this happens...

The best idea I've come up with is to schedule a task to run a script when the computer starts to check if there is a connection to the internet, (maybe pinging my ISP or Google.com) and if that fails then to reboot the computer.

I've done all kinds of google searches, but I can't find any example script of this... any detailed help would be appreciated.

Thanks
0