I would like to run this simple script, that I saved in c:\windows, automatically just before I restart Windows:
I made a Basic Task in Task Scheduler with a trigger set to: "On disconnect from user session" :
If I right click on the task in the library and select the manual "Run" command it will launch the task OK (confirmed in the library) when restarting Windows but when the task is set on automatic ("Ready" in the library) nothing happens when restarting Windows.
Possibly "On disconnect from user session" has nothing to do with restarting Windows and should I use "On a Event" (Basic) trigger "Winlogon" source with a code?
from: Windows / Windows 10 / Windows settings]