How to get an alert when a task completes on Windows 10
Scheduled tasks on Windows 10 are created by the OS as well as by users. The tasks that Windows 10 creates are for running essential services, checking for updates, and periodically checking/ensuring that Windows 10 is activated. If you ever look through the list of scheduled tasks in the Task Scheduler app you will see that there are quite a few of them and they all run silently. It’s rare that a task will ever indicate that it has run. It’s only when it fails that you might see a notification but even that’s not a given. If you want to get an alert when a task completes, you have to manually add it.
Since you need to manually add the alert for task completion, you can’t do this for all tasks in one go. You have to manually add the alert as an action for each task.
Create Alert
The alert that you see will basically be shown in Command Prompt. You cannot easily route it through the Windows 10 action center but there’s a slightly complicated work around to it if you want the alert to look good too.
First, create the task that you want get the alert for. When you’re done, go to the Actions tab, and add a new action. This action should be the very last one in the list.
Click the New button at the bottom of the Action tab and select ‘Start a program’ in the Action dropdown. In the Program/Script box, enter ‘cmd’.
In the Add Arguments box, use the following template;
/C TITLE Title-of-alert &ECHO.&ECHO.&ECHO Message-of-alert &ECHO.&ECHO.&TIMEOUT alert-duration
You need to change;
- Title-of-alert
- Message-of-alert
- alert-duration
The fields you need to change are pretty self-explanatory except the ‘Alert-duration’ one. This defines, in seconds, how long the Command Prompt window remains open before automatically closing. You can also close it by tapping any key.
Using Windows 10 alerts
Showing an alert via Windows 10 alerts, i.e. a toast notification requires using a PowerShell script, and the script will require a PowerShell module in order to work. I’ve detailed the entire process of installing the module BurntToast and how to use it to create a toast notification. You can see that setting it up requires finding an icon if you want it too look good.
Once you have the PowerShell script ready, you need to create a batch script that can run it since PowerShell scripts can’t run automatically on Windows 10. This batch script is what you have to add as an action for a task.