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!

  • 1
    Would it be better to periodically monitor if the network is working in a loop then run the batch script when it isn't? – Owl Sep 12 '19 at 15:14
  • 1
    You can find the applicable event in the event viewer when the disconnect occurs, and then setup that event to trigger the execution of a script. This way it only occurs on that event rather than a periodic or looping script, etc. that runs all the time. – IT Thug Ninja Sep 12 '19 at 15:19
  • if you guys could talk to me like I know LITERALLY nothing! that be great! never even heard of Event Viewer! – Crisan Comis Anca Sep 12 '19 at 15:34

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/

  • ok so il repeat Start only if the following network connection is available is broken after Windows 10 anniversary update. I literally tried that tutorial and it does not WORK! – Crisan Comis Anca Sep 12 '19 at 16:36
  • This will work just fine if you associate the task with an event that is logged when your wireless disconnects. Did you do that? – I say Reinstate Monica Sep 12 '19 at 16:58
  • that tutorial is for windows 7 and down,it will not work with windows 10! and I have no clue how to see the logged event, let alone associate it to a scheduled task. I thought I made that clear I know nothing! – Crisan Comis Anca Sep 12 '19 at 17:43
  • Getting short with people won't help you out. Look in Windows event viewer for an event which looks like a network disconnect, and go from there. The link I posted was to give you some hints... – spikey_richie Sep 12 '19 at 21:21

To create an event that is triggered when the Internet is disconnected, use in Task Scheduler for triggering the task the Event ID 10001.

Log: Microsoft-Windows-NetworkProfile/Operational
Source: NetworkProfile
Event ID: 10001

enter image description here

For more detailed information see the article
Windows Task Scheduler: Trigger an Event When Internet Connects/Disconnects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.