How to launch a bat file the second internet disconects? WINDOWS 10

All I want is to have a bat file I made run the second my wireless internet spontaneously disconnects.

I have tried using task scheduler but I just found out Start only if the following network connection is available is broken after Windows 10 anniversary update. Checked or unchecked, it does not work at all!

any help would be greatly appreciated!


Solution 1:

I don't have exact steps, but you want to use Task Scheduler. Create a new task (not a basic task) with the trigger being On an Event. Select the appropriate Windows Event Viewer log and enter the relevant source ID. You'll need to look through your event viewer logs to find an instance of a disconnect to get your event ID/source.

enter image description here

Your 'Action' will then be to run your batch file.

I don't like posting links to other sites as they can get stale, but as an interim you can look here for more info. https://www.groovypost.com/howto/automatically-run-script-on-internet-connect-network-connection-drop/