Can I use Task Sceduler or Group Policy Management Console to automatically 'close all windows' of Microsoft Sticky Notes when clicking 'Shut Down' on my PC using Windows 10?

NotLenny 0 Reputation points
2024-01-21T11:49:13.4666667+00:00

I have created a task in Task Scheduler for the Microsoft Sticky Notes app downloaded from the Microsoft Store, to open 30 seconds after I turn on my PC and enter the Desktop, but in order for this task to work I need to always remember to manually 'close all windows' of the Microsoft Sticky Notes app on my Taskbar before actually shutting down my PC. If I don't manually 'close all windows' of the Microsoft Sticky Notes app that's on the taskbar - the very next time I turn on my PC and enter the Desktop the actual Sticky Notes I have on my Desktop launch instantly by default which is something I don't want. I only want the Sticky Notes to launch 30 seconds AFTER I turn on the PC and enter the Desktop. In Registry Editor under: Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PenWorkspace\Notes > LaunchOnNextUserSession every time I modify the 'value data' to 0 it always resets to 1. So is there a way to automate whenever I click: 'Shut Down' for the Microsoft Sticky Notes app to firstly 'close all windows' ever so shortly before the PC itself actually shuts down? I tried following this guide but it did not work:

    * Open the Task Scheduler application.

    * Click on “Create Basic Task” on the right side of the Task Scheduler.

    * Name your task and add a description if you wish. Click “Next”.

   *  For the trigger, select “When a specific event is logged”. Click “Next”.

   * Under “Log:”, select “System”. Under “Source:”, select “User32”. Under “Event ID:”, input “1074”. This event ID corresponds to the shutdown event. Click “Next”.

   * Select “Start a program” as the action. Click “Next”.

   * In the “Program/script” box, input “taskkill”. In the “Add arguments” box, input “/IM StikyNot.exe /F”. This command will force close the Sticky Notes application. Click “Next”.

   * Review the settings and click “Finish”.
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Thameur-BOURBITA 36,261 Reputation points Moderator
    2024-01-21T16:45:32.4233333+00:00

    Hi @NotLenny

    You can created a scheduled task and add a trigger based on the following event Source User32 ID 1074 is generated by shutdown process:

    Just before the computer shuts down, shutdown.exe will record the shutdown event in the Windows System log with a Source=User32 and event ID 1074 along with any custom message & reason code.

    https://learn.microsoft.com/en-us/troubleshoot/windows-client/performance/event-id-41-restart


    Please don't forget to accept helpful answer


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.