2

I'm trying to run a task when I get a network connection and am following these steps.

I created a test.bat that does some stuff script that and set the task scheduler trigger for it to Log: Microsoft-Windows-NetworkProfile/Operational Source: NetworkProfile Event ID: 10001

(just on disconnect for now).

When I disconnect from my wifi, in the Event Viewer I can see under Event Viewer->Application and Services Logs->Microsoft->->Windows->NetworkProfile->Operational that the event with ID 10001 is created. However, my bat script is never run. When I run the task manually or schedule it at a certain time, everything works just fine.

  • Does the task's Last Run Time indicate that it attempted to run when the event is logged? If so, what's the Last Run Result? Anything on the History tab of the task? Also, review the Microsoft/Windows/Task Scheduler event log for any relevant events. – Twisty Impersonator Apr 22 '17 at 15:17
1

Found the solution: For some reason, the trigger was set as

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

When I created a new task (I'm so sure I followed the same steps to a T!), the trigger was listed as

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

which worked. (No idea what I did wrong the first time).

  • On my machine the "NetworkProfile" was suggested by Windows itself, but to get it to work you have to use "Microsoft-Windows-NetworkProfile", as you said. Thanks! – Joril Mar 21 '18 at 12:34
-1

I had an event driven task which would not fire upon the event occurring because there is a task "conditions" setting to Start the task only if the computer is on AC power.

I was running a test on my laptop without being plugged in. Thus, the condition was not met! Check all these conditions compared to your exact scenario if you encounter a similar problem.

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.