Display message on screen as was done in Win7 thru Task Scheduler


VicM

New member
Local time
11:09 PM
Posts
6
OS
Windows 11 Pro
Hi,

I recently purchased a new Dell XPS 15 (5930) laptop with Win 11 Pro, Version 22H2 (OS Build 22621.2070). Previous laptop was running Win 7 Pro.

I had quite a few tasks that would display a message on screen to remind me of things I had to attend to. I was disappointed to learn that Win 11 removed the ability to display messages thru the Task Scheduler. I discovered a couple of work arounds on the Net and attempted to employ them. When I tried running them, I would see a flash on the screen, but nothing persisted there. This happened with both of the methods I tried.

One of the methods allowed me to export the task from Win 7 and modify a couple of lines. The other method utilized PowerShell to display a message.

I've exported both tasks as XML files.

The first one is what I exported from my Win 7 box, modifying the <Action> section at the bottom according to what I discovered on the following website: https://www.askvg.com/fix-cant-create-tasks-to-display-messages-in-windows-8-task-scheduler/

XML:
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2013-03-01T18:38:33.8417209</Date>
    <Author>TheVee-LAPTOP\Vic</Author>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2013-03-07T18:30:00</StartBoundary>
      <Enabled>true</Enabled>
      <ScheduleByWeek>
        <DaysOfWeek>
          <Thursday />
        </DaysOfWeek>
        <WeeksInterval>1</WeeksInterval>
      </ScheduleByWeek>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <RunLevel>LeastPrivilege</RunLevel>
      <UserId>TheVee-LAPTOP\Vic</UserId>
      <LogonType>InteractiveToken</LogonType>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>true</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>true</WakeToRun>
    <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
    <Command>msg</Command>
    <Arguments>Backup scheduled at 7:00PM.  Be sure Passport drive and AC power are plugged in!!</Arguments>
    </Exec>
  </Actions>
</Task>

The following code is the one using PowerShell which I got from the following website: How To Run a PowerShell Script on Schedule With Task Scheduler

XML:
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2023-08-02T11:48:30.4317176</Date>
    <Author>TheVee-Laptop\Vic</Author>
    <URI>\Weekly Backup</URI>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2023-08-03T19:00:00</StartBoundary>
      <Enabled>true</Enabled>
      <ScheduleByWeek>
        <DaysOfWeek>
          <Thursday />
        </DaysOfWeek>
        <WeeksInterval>1</WeeksInterval>
      </ScheduleByWeek>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-5-21-1004732214-3397407182-2836769476-1001</UserId>
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe</Command>
      <Arguments>Backup scheduled at 7:00PM.  Be sure Passport drive and AC power are plugged in!!</Arguments>
    </Exec>
  </Actions>
</Task>

I'm not smart enough to understand what that <UserID> is under the <Principals> section.

But as I've mentioned, both of those tasks fire; they just flash something on the screen so fast that I don't even know if the message is displayed.

Can anyone shed some light on this? Would really appreciate it if I could display my messages as I had done in Win 7.

Thanks,

Vic
 

My Computer

System One

  • OS
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell XPS 15
msg.exe still works, but you must provide an argument for who will read the message:
Code:
msg * "Backup scheduled at 7:00PM.  Be sure Passport drive and AC power are plugged in!!"

This command will create a scheduled task to print that message every Thursday night (6:45 PM).
Code:
schtasks /create /sc WEEKLY /tn "BackupReminder" /tr "msg.exe * 'Backup scheduled at 7:00PM.  Be sure Passport drive and AC power are plugged in!!'" /d THU /st 18:45

You can manually test this task by invoking: schtasks /run /tn BackupReminder
 

My Computer

System One

  • OS
    Windows 7
Hi garlin,

Thanks for the reply. I pasted the code in a Cmd Prompt and it created the message. I tested it as per your instruction and it worked just the way I wanted.
However, I'm unfamiliar with the schtasks app and will have to investigate it. But I do like working in the Cmd Prompt having started with computers when DOS was king. LOL

Vic
 

My Computer

System One

  • OS
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell XPS 15

Latest Support Threads

Back
Top Bottom