Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post

    Task Scheduler will not allow Display Message Tasks!

    I am trying to move from my old Vista laptop to my new Win8.1 laptop. I have a lot of scheduled tasks that simply display a reminder message about some specific that I should do. When I try to create a new task that displays a message in Win8.1 it displays "Deprecated" when I select Display a Message and when I try to save the task it will not save it! Why???

    How do I create tasks that will display messages for me?

    Thanks,
    Bill

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Bill,

    These features have been removed from the task schedule in Win 8. Here's an article on how to restore the feature using PowerShell with Task Scheduler. HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post
    Thanks RG. That link you supplied provided the solution that should work on my laptop.

    Bill

  4. #4
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 986 Times in 916 Posts
    I use UK's Kalendar for that sort of thing, much easier than doing it manually.

    cheers, Paul

  5. #5
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post
    Quote Originally Posted by RetiredGeek View Post
    These features have been removed from the task schedule in Win 8. Here's an article on how to restore the feature using PowerShell with Task Scheduler. HTH
    Well, the msg approach sounded very easy to implement so I have tried it for one message and so far I haven't been able to get it to work! It should have displayed a message this morning and that didn't happen so I've tried a number of things and nothing has worked so far. Do you know if the msg capability is in all versions of Win8? When I type msg in a command window I'm told it is unknown. Is the command window the right place to try it manually?

    Thanks,
    Bill

  6. #6
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Bill,

    Ok, here's my implementation of the article using PowerShell. Note the PS is a little longer than it has to be but I included some code to hide the main PS window for neatness.

    PowerShell Code: SchTaskMsgs.ps1
    Code:
    <#
     +--------------------------------------------------------+
     | Computer Mentors Scheduled Task Message Function       |
     | Programmed by: The Computer Mentor                     |
     |           aka: RetiredGeek (WindowsSecrets.com)   )    |
     | License: Free to all but please include credits        |
     | Notes  :                                               |
     | Updated:                                               |
     | Example: SchTaskMsgs.ps1 -MsgTitle "Test Msg"          |
     |                          -MsgText "Beam Me Up Scottie!"|
     +--------------------------------------------------------+
    #>
    
    param (
            [Parameter(Mandatory=$true)]
              [String]$MsgTitle,
            [Parameter(Mandatory=$true)]
              [String]$MsgText
    )
    
    Add-Type -AssemblyName Microsoft.VisualBasic 
    
    # ----------------  add a helper  --------------------
    $showWindowAsync = Add-Type –memberDefinition @” 
    [DllImport("user32.dll")] 
    public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); 
    “@ -name “Win32ShowWindowAsync” -namespace Win32Functions –passThru
    
    function Show-PowerShell() { 
         [void]$showWindowAsync::ShowWindowAsync((Get-Process –id $pid).MainWindowHandle, 10) 
    }
    
    function Hide-PowerShell() { 
        [void]$showWindowAsync::ShowWindowAsync((Get-Process –id $pid).MainWindowHandle, 2) 
    }
    
    # ------------------ End Helper -------------------------------
    
    
    Clear-Host
    
    Hide-PowerShell
    
    $MsgBox = [Microsoft.VisualBasic.Interaction]
    
    [void] $MsgBox::MsgBox($MsgText,0,$MsgTitle)
    
    Show-PowerShell
    This is generic code so you can easily pass any message text and title to the routine.

    Here's the Scheduled Task XML file which can be easily edited and renamed to change the messages:
    Code:
    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
      <RegistrationInfo>
        <Author>DellXPS8700\Bruce</Author>
        <Description>No Description Supplied</Description>
      </RegistrationInfo>
      <Triggers />
      <Principals>
        <Principal id="Author">
          <UserId>DellXPS8700\Bruce</UserId>
          <LogonType>InteractiveToken</LogonType>
          <RunLevel>LeastPrivilege</RunLevel>
        </Principal>
      </Principals>
      <Settings>
        <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
        <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
        <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
        <AllowHardTerminate>true</AllowHardTerminate>
        <StartWhenAvailable>false</StartWhenAvailable>
        <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
        <IdleSettings>
          <StopOnIdleEnd>false</StopOnIdleEnd>
          <RestartOnIdle>false</RestartOnIdle>
        </IdleSettings>
        <AllowStartOnDemand>true</AllowStartOnDemand>
        <Enabled>true</Enabled>
        <Hidden>false</Hidden>
        <RunOnlyIfIdle>false</RunOnlyIfIdle>
        <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
        <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
        <WakeToRun>false</WakeToRun>
        <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
        <Priority>7</Priority>
      </Settings>
      <Actions Context="Author">
        <Exec>
          <Command>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</Command>
          <Arguments>G:\BEKDocs\Scripts\SchTaskMsgs.ps1 -MsgTitle 'Test Msg' -MsgText 'Beam Me Up Scottie!'</Arguments>
        </Exec>
      </Actions>
    </Task>
    All you have to change are the two items in red and then save as a new name.xml and import into task scheduler.

    Note: The first time you edit the XML you'll need to change the 2 references to DellXPS8700\Bruce to your own MachineName\Userid. You'll also have to change the Drive\Path to the file.

    If you have never used PowerShell before read this thread posts #1 items 1-3:

    Sample Output:
    scottie.JPG

    HTH
    Last edited by RetiredGeek; 2015-07-30 at 18:10.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  7. #7
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post
    Thanks RG for the suggestion. I'll try that for my stuff. The code windows show vertical scroll bars that indicate that some of the code is not visible in each case. Is this true or is it all there where I can do a copy and paste?

    Thanks,
    Bill

  8. #8
    Super Moderator
    Join Date
    Jun 2011
    Location
    New England
    Posts
    4,752
    Thanks
    171
    Thanked 650 Times in 573 Posts
    Quote Originally Posted by BillWilson View Post
    The code windows show vertical scroll bars that indicate that some of the code is not visible in each case. Is this true or is it all there where I can do a copy and paste?
    It's visible if you scroll down. Or use the Select All button at the top.

  9. #9
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post
    Quote Originally Posted by RetiredGeek View Post
    Bill,

    Ok, here's my implementation of the article using PowerShell. Note the PS is a little longer than it has to be but I included some code to hide the main PS window for neatness.

    PowerShell Code: SchTaskMsgs.ps1 . . .
    RG:

    I'm back on this subject again and I've decided to go with your suggested approach in your message earlier in this thread. I'm not completely clear on where I am to put the PowerShell script that you named SchTaskMsgs.ps1.

    Also, the outside article that you referenced earlier says this:
    When you open "Actions" tab, click on "New" button (or click on "Edit" button if you are editing the imported task) and type powershell in "Program/script" textbox and in "Add arguments" textbox paste following string:


    -WindowStyle hidden -Command "& {[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('Your_Desired_Message','Your_Desired_Title' )}
    Do I use that in the Task Scheduler just as the outside article specified?

    Thanks,
    Bill

  10. #10
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 986 Times in 916 Posts
    Create the PS1 file and store it in a convenient location.
    Edit the XML as described. You need to change this bit to the location of your PS1 script: "G:\BEKDocs\Scripts"
    Save the XML and then import it into Task Scheduler by clicking on "Task Library" and then "Import Task".
    Edit the task as required.

    Don't forget to allow PowerShell script execution.

    cheers, Paul

  11. #11
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post
    Thanks for setting me straight, Paul. I believe I am all set now.

    Bill

  12. #12
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post
    RetiredGeek, I have used your PowerShell code and task script above to get several reminder messages working on my new laptop. Thanks so much for the code routines.

    Do you know if there is any reasonable way to keep the PowerShell screen from occupying space on the taskbar? That would be desirable. Also, is there a way to make the new message open up as the active item so it will be immediately visible. I don't necessarily want it to be forced to remain on top but just to be more visible when it first pops up.

    Thanks for your samples and help.
    Bill

  13. #13
    WS Lounge VIP access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    1,725
    Thanks
    147
    Thanked 156 Times in 149 Posts
    Quote Originally Posted by RetiredGeek View Post

    Sample Output:
    scottie.JPG

    HTH
    I keep seeing this RG and have to comment, sorry - No one ever said beam me up Scottie in TOS

  14. #14
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Quote Originally Posted by BillWilson View Post
    RetiredGeek, I have used your PowerShell code and task script above to get several reminder messages working on my new laptop. Thanks so much for the code routines.
    You're Welcome.

    Do you know if there is any reasonable way to keep the PowerShell screen from occupying space on the taskbar?
    Not that I'm aware of.

    That would be desirable. Also, is there a way to make the new message open up as the active item so it will be immediately visible.
    It always does on my machine. Of course, if you click somewhere else it will go to the back. Of course, that where having the PS icon on the task bar helps as it informs you there is something there to look at.

    Sorry I can't be of more assistance.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  15. #15
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post
    Thanks RG!

    Bill

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •