Windows Task Scheduler: Event - on connect to network
- Open the Task Scheduler. You can find it by typing
Task Schedulerinto the start menu search box. -
In the Task Scheduler library, create a new task by clicking
Create Taskin the Actions panel on the right side.
-
Give the task a name like “detect network connect” or whatever you choose
-
On the
Triggerstab, clickNew...and selectOn an Eventfrom the dropdown box.
-
Choose the following settings:
- Log:
Microsoft-Windows-NetworkProfile/Operational - Source:
NetworkProfile - Event ID:
10000
- Log:
- Click OK, then go to the
Conditionstab. - Check the box for
Start only if the following network connection is availableand choose the network you want to run the script with - Under the
Actionstab, clickNew...and selectStart a program. Enter the location of the script file you want to run, then clickOK. - Set any other task settings you want to, then click
OK.
On disconnect
- Follow steps 2-4 above
- Use the following event trigger settings:
- Log:
Microsoft-Windows-NetworkProfile/Operational - Source:
NetworkProfile - Event ID:
10001
- Log:
- Skip steps 6-7, as you will no longer be attached to any network at all. This event will therefore runany time you disconnect from any network.
- Follow steps 8-9 again














