Display message box from Task Scheduler on top of all other windows











up vote
7
down vote

favorite
3












Is there a nice way to get a message box to pop up at a scheduled time on top of other windows? The default "Display a Message" action uselessly appears below everything else.










share|improve this question


























    up vote
    7
    down vote

    favorite
    3












    Is there a nice way to get a message box to pop up at a scheduled time on top of other windows? The default "Display a Message" action uselessly appears below everything else.










    share|improve this question
























      up vote
      7
      down vote

      favorite
      3









      up vote
      7
      down vote

      favorite
      3






      3





      Is there a nice way to get a message box to pop up at a scheduled time on top of other windows? The default "Display a Message" action uselessly appears below everything else.










      share|improve this question













      Is there a nice way to get a message box to pop up at a scheduled time on top of other windows? The default "Display a Message" action uselessly appears below everything else.







      windows window task-scheduler






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 31 '14 at 17:47









      Moss

      2952416




      2952416






















          4 Answers
          4






          active

          oldest

          votes

















          up vote
          8
          down vote



          accepted










          How about using Window's built-in msg command like so?



          msg * "Message you would like to send"



          You can add other parameters such as /TIME:x where x is the number of seconds you want the message to display. Of course, msg /? will show you all the options available.



          This implies Windows XP and higher as the system where you want to display the message. If you have a Home Edition of the applicable OS, you're out of luck. See http://ss64.com/nt/msg.html for available parameters.



          If you have a Home Edition, the following batch script will pop-up a message using VBSCript's PopUp method:



          @echo off
          ::See http://msdn.microsoft.com/en-us/library/x83z1d9f(v=vs.84).aspx
          ::for an explanation of the PopUp method
          ::

          ::Use the directory from whence script was called as working directory
          set CWD=%~dp0

          ::Use a random file name for the temporary VBScript.
          set usrmsg=%CWD%%random%.vbs

          ::First parameter is the timeout in seconds. 0 = wait forever
          set _timeout=%~1

          ::Second parameter is the message, enclosed in quotes.
          set _Message=%~2

          ::Third parameter is the title of the window, enclosed in quotes.
          set _Title=%~3

          ::This last variable is used to display a button/icon on the window.
          ::Setting this to 4096 sets the window to Modal (on top of everything else)
          set _nType=4160

          ::Create the temp script using the provided information.
          ECHO Set wshShell = CreateObject( "WScript.Shell" )>%usrmsg%
          ECHO wshShell.Popup "%_Message%" ^& vbCrLf, %_Timeout%, "%_Title%", %_nType%>>%usrmsg%

          ::Run the script.
          WSCRIPT.EXE %usrmsg%

          ::Delete the script.
          DEL %usrmsg%

          ::Exit the batch file
          exit /b


          Hope this helps!



          Added: Gregg mentions in the comments that in order for this to work in Windows 10, you must use "/time:0" if you want the message to stay on-screen longer than 60 seconds.






          share|improve this answer























          • What are you talking about? What is msg? I get nothing if I try to run it from the Run box or from the command prompt.
            – Moss
            Feb 2 '14 at 2:16










          • You didn't specify in your question which version of Windows you have. If you have a Home edition, you're out of luck. ss64.com/nt/msg.html
            – JSanchez
            Feb 2 '14 at 6:11






          • 1




            FYI msg automatically closes after 60sec unless you specify /TIME:0. This is on Win10 x64 v1607 Enterprise LTSB. I was wondering why my script tested fine, but I never got message when I put in Task Scheduler. Shameful plug: serverfault.com/a/931932/131761
            – gregg
            Sep 20 at 19:55


















          up vote
          4
          down vote













          Also see https://www.howtogeek.com/136894/how-to-create-popup-reminders-with-no-additional-software/. In case of link death, I'll summarize here:




          1. Open Windows Task Scheduler (search 'Task Scheduler' in the Start menu)

          2. Under Actions, click 'Create Task'

          3. In the General tab, make sure 'Run only when user is logged on' is checked, and 'Hidden' is NOT checked

          4. In the Triggers tab, click 'New' to set a time for the message to trigger

          5. In the Actions tab, click 'New' and make sure the selected action at the top is 'Start a program'

          6. In 'Program/script', type CMD

          7. In 'Add arguments', copy and paste this:


            /C TITLE [Your title here] &ECHO.&ECHO.&ECHO [Your message here] &ECHO.&ECHO.&TIMEOUT [timeout]




          8. Replace [Your title here] and [Your message here] with your preferred text (do not include the brackets)

          9. Replace [timeout] with the number of seconds you want the message to wait before timing out, or -1 if you don't want it to time out (either way, a key press while the console window is in focus will close it)

          10. Click 'OK'!


          This will generate a console window with the given text, which will appear ON TOP of your current window, but won't automatically steal the focus (you can keep interacting with your current window as usual).



          This was the best solution I found, hope it helps someone!






          share|improve this answer





















          • This should be the accepted answer very slick, thank you!
            – spartikus
            Mar 28 at 16:08


















          up vote
          1
          down vote













          Display a Message is deprecated, and msg command didn't work for me in Windows 10 1703. I'm using powershell to display the message box from a scheduled task, use this as arguments when defining the action:



          -WindowStyle hidden -Command "& {[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('<message body here>','<window title here>')}"


          It's ugly AF, but it works.






          share|improve this answer





















          • You might want to state what happens when you use your solution. The error may be helpful to other users.
            – Stese
            May 24 '17 at 14:23










          • I don't get what is missing from my response. When I use the powershell solution a message box appears. When using the msg solution nothing happens, as I state in my comment.
            – isalgueiro
            May 24 '17 at 14:40










          • I tried the same with powershell -WindowStyle hidden -File "<path to script>" but it doesn't work, it works only with -Command argument, so: powershell -WindowStyle hidden -Command "& '<path to script>'"
            – Mattia72
            Nov 3 '17 at 6:29




















          up vote
          0
          down vote













          Use msgbox in vbs. like this:



          Set filesys = CreateObject("Scripting.FileSystemObject") 
          Set shell = CreateObject("Shell.Application")
          Set wshShell = WScript.CreateObject( "WScript.Shell" )
          PCName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
          msgbox "Dear user on " & PCName & vbcrlf & " " & vbcrlf & "This is a message box on top of all other windows.", &h51000, "I am msgbox"
          shell.Open "C:Users"


          Code &h51000 will make sure msgbox in central and on top of all other windows all the time.



          If you only want to schedule a msgbox, you can simply use task scheduler, there is a built in function to schedule a message. see location of [start a program] in task scheduler.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f709725%2fdisplay-message-box-from-task-scheduler-on-top-of-all-other-windows%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            8
            down vote



            accepted










            How about using Window's built-in msg command like so?



            msg * "Message you would like to send"



            You can add other parameters such as /TIME:x where x is the number of seconds you want the message to display. Of course, msg /? will show you all the options available.



            This implies Windows XP and higher as the system where you want to display the message. If you have a Home Edition of the applicable OS, you're out of luck. See http://ss64.com/nt/msg.html for available parameters.



            If you have a Home Edition, the following batch script will pop-up a message using VBSCript's PopUp method:



            @echo off
            ::See http://msdn.microsoft.com/en-us/library/x83z1d9f(v=vs.84).aspx
            ::for an explanation of the PopUp method
            ::

            ::Use the directory from whence script was called as working directory
            set CWD=%~dp0

            ::Use a random file name for the temporary VBScript.
            set usrmsg=%CWD%%random%.vbs

            ::First parameter is the timeout in seconds. 0 = wait forever
            set _timeout=%~1

            ::Second parameter is the message, enclosed in quotes.
            set _Message=%~2

            ::Third parameter is the title of the window, enclosed in quotes.
            set _Title=%~3

            ::This last variable is used to display a button/icon on the window.
            ::Setting this to 4096 sets the window to Modal (on top of everything else)
            set _nType=4160

            ::Create the temp script using the provided information.
            ECHO Set wshShell = CreateObject( "WScript.Shell" )>%usrmsg%
            ECHO wshShell.Popup "%_Message%" ^& vbCrLf, %_Timeout%, "%_Title%", %_nType%>>%usrmsg%

            ::Run the script.
            WSCRIPT.EXE %usrmsg%

            ::Delete the script.
            DEL %usrmsg%

            ::Exit the batch file
            exit /b


            Hope this helps!



            Added: Gregg mentions in the comments that in order for this to work in Windows 10, you must use "/time:0" if you want the message to stay on-screen longer than 60 seconds.






            share|improve this answer























            • What are you talking about? What is msg? I get nothing if I try to run it from the Run box or from the command prompt.
              – Moss
              Feb 2 '14 at 2:16










            • You didn't specify in your question which version of Windows you have. If you have a Home edition, you're out of luck. ss64.com/nt/msg.html
              – JSanchez
              Feb 2 '14 at 6:11






            • 1




              FYI msg automatically closes after 60sec unless you specify /TIME:0. This is on Win10 x64 v1607 Enterprise LTSB. I was wondering why my script tested fine, but I never got message when I put in Task Scheduler. Shameful plug: serverfault.com/a/931932/131761
              – gregg
              Sep 20 at 19:55















            up vote
            8
            down vote



            accepted










            How about using Window's built-in msg command like so?



            msg * "Message you would like to send"



            You can add other parameters such as /TIME:x where x is the number of seconds you want the message to display. Of course, msg /? will show you all the options available.



            This implies Windows XP and higher as the system where you want to display the message. If you have a Home Edition of the applicable OS, you're out of luck. See http://ss64.com/nt/msg.html for available parameters.



            If you have a Home Edition, the following batch script will pop-up a message using VBSCript's PopUp method:



            @echo off
            ::See http://msdn.microsoft.com/en-us/library/x83z1d9f(v=vs.84).aspx
            ::for an explanation of the PopUp method
            ::

            ::Use the directory from whence script was called as working directory
            set CWD=%~dp0

            ::Use a random file name for the temporary VBScript.
            set usrmsg=%CWD%%random%.vbs

            ::First parameter is the timeout in seconds. 0 = wait forever
            set _timeout=%~1

            ::Second parameter is the message, enclosed in quotes.
            set _Message=%~2

            ::Third parameter is the title of the window, enclosed in quotes.
            set _Title=%~3

            ::This last variable is used to display a button/icon on the window.
            ::Setting this to 4096 sets the window to Modal (on top of everything else)
            set _nType=4160

            ::Create the temp script using the provided information.
            ECHO Set wshShell = CreateObject( "WScript.Shell" )>%usrmsg%
            ECHO wshShell.Popup "%_Message%" ^& vbCrLf, %_Timeout%, "%_Title%", %_nType%>>%usrmsg%

            ::Run the script.
            WSCRIPT.EXE %usrmsg%

            ::Delete the script.
            DEL %usrmsg%

            ::Exit the batch file
            exit /b


            Hope this helps!



            Added: Gregg mentions in the comments that in order for this to work in Windows 10, you must use "/time:0" if you want the message to stay on-screen longer than 60 seconds.






            share|improve this answer























            • What are you talking about? What is msg? I get nothing if I try to run it from the Run box or from the command prompt.
              – Moss
              Feb 2 '14 at 2:16










            • You didn't specify in your question which version of Windows you have. If you have a Home edition, you're out of luck. ss64.com/nt/msg.html
              – JSanchez
              Feb 2 '14 at 6:11






            • 1




              FYI msg automatically closes after 60sec unless you specify /TIME:0. This is on Win10 x64 v1607 Enterprise LTSB. I was wondering why my script tested fine, but I never got message when I put in Task Scheduler. Shameful plug: serverfault.com/a/931932/131761
              – gregg
              Sep 20 at 19:55













            up vote
            8
            down vote



            accepted







            up vote
            8
            down vote



            accepted






            How about using Window's built-in msg command like so?



            msg * "Message you would like to send"



            You can add other parameters such as /TIME:x where x is the number of seconds you want the message to display. Of course, msg /? will show you all the options available.



            This implies Windows XP and higher as the system where you want to display the message. If you have a Home Edition of the applicable OS, you're out of luck. See http://ss64.com/nt/msg.html for available parameters.



            If you have a Home Edition, the following batch script will pop-up a message using VBSCript's PopUp method:



            @echo off
            ::See http://msdn.microsoft.com/en-us/library/x83z1d9f(v=vs.84).aspx
            ::for an explanation of the PopUp method
            ::

            ::Use the directory from whence script was called as working directory
            set CWD=%~dp0

            ::Use a random file name for the temporary VBScript.
            set usrmsg=%CWD%%random%.vbs

            ::First parameter is the timeout in seconds. 0 = wait forever
            set _timeout=%~1

            ::Second parameter is the message, enclosed in quotes.
            set _Message=%~2

            ::Third parameter is the title of the window, enclosed in quotes.
            set _Title=%~3

            ::This last variable is used to display a button/icon on the window.
            ::Setting this to 4096 sets the window to Modal (on top of everything else)
            set _nType=4160

            ::Create the temp script using the provided information.
            ECHO Set wshShell = CreateObject( "WScript.Shell" )>%usrmsg%
            ECHO wshShell.Popup "%_Message%" ^& vbCrLf, %_Timeout%, "%_Title%", %_nType%>>%usrmsg%

            ::Run the script.
            WSCRIPT.EXE %usrmsg%

            ::Delete the script.
            DEL %usrmsg%

            ::Exit the batch file
            exit /b


            Hope this helps!



            Added: Gregg mentions in the comments that in order for this to work in Windows 10, you must use "/time:0" if you want the message to stay on-screen longer than 60 seconds.






            share|improve this answer














            How about using Window's built-in msg command like so?



            msg * "Message you would like to send"



            You can add other parameters such as /TIME:x where x is the number of seconds you want the message to display. Of course, msg /? will show you all the options available.



            This implies Windows XP and higher as the system where you want to display the message. If you have a Home Edition of the applicable OS, you're out of luck. See http://ss64.com/nt/msg.html for available parameters.



            If you have a Home Edition, the following batch script will pop-up a message using VBSCript's PopUp method:



            @echo off
            ::See http://msdn.microsoft.com/en-us/library/x83z1d9f(v=vs.84).aspx
            ::for an explanation of the PopUp method
            ::

            ::Use the directory from whence script was called as working directory
            set CWD=%~dp0

            ::Use a random file name for the temporary VBScript.
            set usrmsg=%CWD%%random%.vbs

            ::First parameter is the timeout in seconds. 0 = wait forever
            set _timeout=%~1

            ::Second parameter is the message, enclosed in quotes.
            set _Message=%~2

            ::Third parameter is the title of the window, enclosed in quotes.
            set _Title=%~3

            ::This last variable is used to display a button/icon on the window.
            ::Setting this to 4096 sets the window to Modal (on top of everything else)
            set _nType=4160

            ::Create the temp script using the provided information.
            ECHO Set wshShell = CreateObject( "WScript.Shell" )>%usrmsg%
            ECHO wshShell.Popup "%_Message%" ^& vbCrLf, %_Timeout%, "%_Title%", %_nType%>>%usrmsg%

            ::Run the script.
            WSCRIPT.EXE %usrmsg%

            ::Delete the script.
            DEL %usrmsg%

            ::Exit the batch file
            exit /b


            Hope this helps!



            Added: Gregg mentions in the comments that in order for this to work in Windows 10, you must use "/time:0" if you want the message to stay on-screen longer than 60 seconds.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 10 hours ago

























            answered Jan 31 '14 at 17:57









            JSanchez

            1,50289




            1,50289












            • What are you talking about? What is msg? I get nothing if I try to run it from the Run box or from the command prompt.
              – Moss
              Feb 2 '14 at 2:16










            • You didn't specify in your question which version of Windows you have. If you have a Home edition, you're out of luck. ss64.com/nt/msg.html
              – JSanchez
              Feb 2 '14 at 6:11






            • 1




              FYI msg automatically closes after 60sec unless you specify /TIME:0. This is on Win10 x64 v1607 Enterprise LTSB. I was wondering why my script tested fine, but I never got message when I put in Task Scheduler. Shameful plug: serverfault.com/a/931932/131761
              – gregg
              Sep 20 at 19:55


















            • What are you talking about? What is msg? I get nothing if I try to run it from the Run box or from the command prompt.
              – Moss
              Feb 2 '14 at 2:16










            • You didn't specify in your question which version of Windows you have. If you have a Home edition, you're out of luck. ss64.com/nt/msg.html
              – JSanchez
              Feb 2 '14 at 6:11






            • 1




              FYI msg automatically closes after 60sec unless you specify /TIME:0. This is on Win10 x64 v1607 Enterprise LTSB. I was wondering why my script tested fine, but I never got message when I put in Task Scheduler. Shameful plug: serverfault.com/a/931932/131761
              – gregg
              Sep 20 at 19:55
















            What are you talking about? What is msg? I get nothing if I try to run it from the Run box or from the command prompt.
            – Moss
            Feb 2 '14 at 2:16




            What are you talking about? What is msg? I get nothing if I try to run it from the Run box or from the command prompt.
            – Moss
            Feb 2 '14 at 2:16












            You didn't specify in your question which version of Windows you have. If you have a Home edition, you're out of luck. ss64.com/nt/msg.html
            – JSanchez
            Feb 2 '14 at 6:11




            You didn't specify in your question which version of Windows you have. If you have a Home edition, you're out of luck. ss64.com/nt/msg.html
            – JSanchez
            Feb 2 '14 at 6:11




            1




            1




            FYI msg automatically closes after 60sec unless you specify /TIME:0. This is on Win10 x64 v1607 Enterprise LTSB. I was wondering why my script tested fine, but I never got message when I put in Task Scheduler. Shameful plug: serverfault.com/a/931932/131761
            – gregg
            Sep 20 at 19:55




            FYI msg automatically closes after 60sec unless you specify /TIME:0. This is on Win10 x64 v1607 Enterprise LTSB. I was wondering why my script tested fine, but I never got message when I put in Task Scheduler. Shameful plug: serverfault.com/a/931932/131761
            – gregg
            Sep 20 at 19:55












            up vote
            4
            down vote













            Also see https://www.howtogeek.com/136894/how-to-create-popup-reminders-with-no-additional-software/. In case of link death, I'll summarize here:




            1. Open Windows Task Scheduler (search 'Task Scheduler' in the Start menu)

            2. Under Actions, click 'Create Task'

            3. In the General tab, make sure 'Run only when user is logged on' is checked, and 'Hidden' is NOT checked

            4. In the Triggers tab, click 'New' to set a time for the message to trigger

            5. In the Actions tab, click 'New' and make sure the selected action at the top is 'Start a program'

            6. In 'Program/script', type CMD

            7. In 'Add arguments', copy and paste this:


              /C TITLE [Your title here] &ECHO.&ECHO.&ECHO [Your message here] &ECHO.&ECHO.&TIMEOUT [timeout]




            8. Replace [Your title here] and [Your message here] with your preferred text (do not include the brackets)

            9. Replace [timeout] with the number of seconds you want the message to wait before timing out, or -1 if you don't want it to time out (either way, a key press while the console window is in focus will close it)

            10. Click 'OK'!


            This will generate a console window with the given text, which will appear ON TOP of your current window, but won't automatically steal the focus (you can keep interacting with your current window as usual).



            This was the best solution I found, hope it helps someone!






            share|improve this answer





















            • This should be the accepted answer very slick, thank you!
              – spartikus
              Mar 28 at 16:08















            up vote
            4
            down vote













            Also see https://www.howtogeek.com/136894/how-to-create-popup-reminders-with-no-additional-software/. In case of link death, I'll summarize here:




            1. Open Windows Task Scheduler (search 'Task Scheduler' in the Start menu)

            2. Under Actions, click 'Create Task'

            3. In the General tab, make sure 'Run only when user is logged on' is checked, and 'Hidden' is NOT checked

            4. In the Triggers tab, click 'New' to set a time for the message to trigger

            5. In the Actions tab, click 'New' and make sure the selected action at the top is 'Start a program'

            6. In 'Program/script', type CMD

            7. In 'Add arguments', copy and paste this:


              /C TITLE [Your title here] &ECHO.&ECHO.&ECHO [Your message here] &ECHO.&ECHO.&TIMEOUT [timeout]




            8. Replace [Your title here] and [Your message here] with your preferred text (do not include the brackets)

            9. Replace [timeout] with the number of seconds you want the message to wait before timing out, or -1 if you don't want it to time out (either way, a key press while the console window is in focus will close it)

            10. Click 'OK'!


            This will generate a console window with the given text, which will appear ON TOP of your current window, but won't automatically steal the focus (you can keep interacting with your current window as usual).



            This was the best solution I found, hope it helps someone!






            share|improve this answer





















            • This should be the accepted answer very slick, thank you!
              – spartikus
              Mar 28 at 16:08













            up vote
            4
            down vote










            up vote
            4
            down vote









            Also see https://www.howtogeek.com/136894/how-to-create-popup-reminders-with-no-additional-software/. In case of link death, I'll summarize here:




            1. Open Windows Task Scheduler (search 'Task Scheduler' in the Start menu)

            2. Under Actions, click 'Create Task'

            3. In the General tab, make sure 'Run only when user is logged on' is checked, and 'Hidden' is NOT checked

            4. In the Triggers tab, click 'New' to set a time for the message to trigger

            5. In the Actions tab, click 'New' and make sure the selected action at the top is 'Start a program'

            6. In 'Program/script', type CMD

            7. In 'Add arguments', copy and paste this:


              /C TITLE [Your title here] &ECHO.&ECHO.&ECHO [Your message here] &ECHO.&ECHO.&TIMEOUT [timeout]




            8. Replace [Your title here] and [Your message here] with your preferred text (do not include the brackets)

            9. Replace [timeout] with the number of seconds you want the message to wait before timing out, or -1 if you don't want it to time out (either way, a key press while the console window is in focus will close it)

            10. Click 'OK'!


            This will generate a console window with the given text, which will appear ON TOP of your current window, but won't automatically steal the focus (you can keep interacting with your current window as usual).



            This was the best solution I found, hope it helps someone!






            share|improve this answer












            Also see https://www.howtogeek.com/136894/how-to-create-popup-reminders-with-no-additional-software/. In case of link death, I'll summarize here:




            1. Open Windows Task Scheduler (search 'Task Scheduler' in the Start menu)

            2. Under Actions, click 'Create Task'

            3. In the General tab, make sure 'Run only when user is logged on' is checked, and 'Hidden' is NOT checked

            4. In the Triggers tab, click 'New' to set a time for the message to trigger

            5. In the Actions tab, click 'New' and make sure the selected action at the top is 'Start a program'

            6. In 'Program/script', type CMD

            7. In 'Add arguments', copy and paste this:


              /C TITLE [Your title here] &ECHO.&ECHO.&ECHO [Your message here] &ECHO.&ECHO.&TIMEOUT [timeout]




            8. Replace [Your title here] and [Your message here] with your preferred text (do not include the brackets)

            9. Replace [timeout] with the number of seconds you want the message to wait before timing out, or -1 if you don't want it to time out (either way, a key press while the console window is in focus will close it)

            10. Click 'OK'!


            This will generate a console window with the given text, which will appear ON TOP of your current window, but won't automatically steal the focus (you can keep interacting with your current window as usual).



            This was the best solution I found, hope it helps someone!







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 7 at 23:48









            Wanderspeak

            412




            412












            • This should be the accepted answer very slick, thank you!
              – spartikus
              Mar 28 at 16:08


















            • This should be the accepted answer very slick, thank you!
              – spartikus
              Mar 28 at 16:08
















            This should be the accepted answer very slick, thank you!
            – spartikus
            Mar 28 at 16:08




            This should be the accepted answer very slick, thank you!
            – spartikus
            Mar 28 at 16:08










            up vote
            1
            down vote













            Display a Message is deprecated, and msg command didn't work for me in Windows 10 1703. I'm using powershell to display the message box from a scheduled task, use this as arguments when defining the action:



            -WindowStyle hidden -Command "& {[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('<message body here>','<window title here>')}"


            It's ugly AF, but it works.






            share|improve this answer





















            • You might want to state what happens when you use your solution. The error may be helpful to other users.
              – Stese
              May 24 '17 at 14:23










            • I don't get what is missing from my response. When I use the powershell solution a message box appears. When using the msg solution nothing happens, as I state in my comment.
              – isalgueiro
              May 24 '17 at 14:40










            • I tried the same with powershell -WindowStyle hidden -File "<path to script>" but it doesn't work, it works only with -Command argument, so: powershell -WindowStyle hidden -Command "& '<path to script>'"
              – Mattia72
              Nov 3 '17 at 6:29

















            up vote
            1
            down vote













            Display a Message is deprecated, and msg command didn't work for me in Windows 10 1703. I'm using powershell to display the message box from a scheduled task, use this as arguments when defining the action:



            -WindowStyle hidden -Command "& {[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('<message body here>','<window title here>')}"


            It's ugly AF, but it works.






            share|improve this answer





















            • You might want to state what happens when you use your solution. The error may be helpful to other users.
              – Stese
              May 24 '17 at 14:23










            • I don't get what is missing from my response. When I use the powershell solution a message box appears. When using the msg solution nothing happens, as I state in my comment.
              – isalgueiro
              May 24 '17 at 14:40










            • I tried the same with powershell -WindowStyle hidden -File "<path to script>" but it doesn't work, it works only with -Command argument, so: powershell -WindowStyle hidden -Command "& '<path to script>'"
              – Mattia72
              Nov 3 '17 at 6:29















            up vote
            1
            down vote










            up vote
            1
            down vote









            Display a Message is deprecated, and msg command didn't work for me in Windows 10 1703. I'm using powershell to display the message box from a scheduled task, use this as arguments when defining the action:



            -WindowStyle hidden -Command "& {[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('<message body here>','<window title here>')}"


            It's ugly AF, but it works.






            share|improve this answer












            Display a Message is deprecated, and msg command didn't work for me in Windows 10 1703. I'm using powershell to display the message box from a scheduled task, use this as arguments when defining the action:



            -WindowStyle hidden -Command "& {[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('<message body here>','<window title here>')}"


            It's ugly AF, but it works.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 24 '17 at 12:23









            isalgueiro

            1113




            1113












            • You might want to state what happens when you use your solution. The error may be helpful to other users.
              – Stese
              May 24 '17 at 14:23










            • I don't get what is missing from my response. When I use the powershell solution a message box appears. When using the msg solution nothing happens, as I state in my comment.
              – isalgueiro
              May 24 '17 at 14:40










            • I tried the same with powershell -WindowStyle hidden -File "<path to script>" but it doesn't work, it works only with -Command argument, so: powershell -WindowStyle hidden -Command "& '<path to script>'"
              – Mattia72
              Nov 3 '17 at 6:29




















            • You might want to state what happens when you use your solution. The error may be helpful to other users.
              – Stese
              May 24 '17 at 14:23










            • I don't get what is missing from my response. When I use the powershell solution a message box appears. When using the msg solution nothing happens, as I state in my comment.
              – isalgueiro
              May 24 '17 at 14:40










            • I tried the same with powershell -WindowStyle hidden -File "<path to script>" but it doesn't work, it works only with -Command argument, so: powershell -WindowStyle hidden -Command "& '<path to script>'"
              – Mattia72
              Nov 3 '17 at 6:29


















            You might want to state what happens when you use your solution. The error may be helpful to other users.
            – Stese
            May 24 '17 at 14:23




            You might want to state what happens when you use your solution. The error may be helpful to other users.
            – Stese
            May 24 '17 at 14:23












            I don't get what is missing from my response. When I use the powershell solution a message box appears. When using the msg solution nothing happens, as I state in my comment.
            – isalgueiro
            May 24 '17 at 14:40




            I don't get what is missing from my response. When I use the powershell solution a message box appears. When using the msg solution nothing happens, as I state in my comment.
            – isalgueiro
            May 24 '17 at 14:40












            I tried the same with powershell -WindowStyle hidden -File "<path to script>" but it doesn't work, it works only with -Command argument, so: powershell -WindowStyle hidden -Command "& '<path to script>'"
            – Mattia72
            Nov 3 '17 at 6:29






            I tried the same with powershell -WindowStyle hidden -File "<path to script>" but it doesn't work, it works only with -Command argument, so: powershell -WindowStyle hidden -Command "& '<path to script>'"
            – Mattia72
            Nov 3 '17 at 6:29












            up vote
            0
            down vote













            Use msgbox in vbs. like this:



            Set filesys = CreateObject("Scripting.FileSystemObject") 
            Set shell = CreateObject("Shell.Application")
            Set wshShell = WScript.CreateObject( "WScript.Shell" )
            PCName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
            msgbox "Dear user on " & PCName & vbcrlf & " " & vbcrlf & "This is a message box on top of all other windows.", &h51000, "I am msgbox"
            shell.Open "C:Users"


            Code &h51000 will make sure msgbox in central and on top of all other windows all the time.



            If you only want to schedule a msgbox, you can simply use task scheduler, there is a built in function to schedule a message. see location of [start a program] in task scheduler.






            share|improve this answer

























              up vote
              0
              down vote













              Use msgbox in vbs. like this:



              Set filesys = CreateObject("Scripting.FileSystemObject") 
              Set shell = CreateObject("Shell.Application")
              Set wshShell = WScript.CreateObject( "WScript.Shell" )
              PCName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
              msgbox "Dear user on " & PCName & vbcrlf & " " & vbcrlf & "This is a message box on top of all other windows.", &h51000, "I am msgbox"
              shell.Open "C:Users"


              Code &h51000 will make sure msgbox in central and on top of all other windows all the time.



              If you only want to schedule a msgbox, you can simply use task scheduler, there is a built in function to schedule a message. see location of [start a program] in task scheduler.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                Use msgbox in vbs. like this:



                Set filesys = CreateObject("Scripting.FileSystemObject") 
                Set shell = CreateObject("Shell.Application")
                Set wshShell = WScript.CreateObject( "WScript.Shell" )
                PCName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
                msgbox "Dear user on " & PCName & vbcrlf & " " & vbcrlf & "This is a message box on top of all other windows.", &h51000, "I am msgbox"
                shell.Open "C:Users"


                Code &h51000 will make sure msgbox in central and on top of all other windows all the time.



                If you only want to schedule a msgbox, you can simply use task scheduler, there is a built in function to schedule a message. see location of [start a program] in task scheduler.






                share|improve this answer












                Use msgbox in vbs. like this:



                Set filesys = CreateObject("Scripting.FileSystemObject") 
                Set shell = CreateObject("Shell.Application")
                Set wshShell = WScript.CreateObject( "WScript.Shell" )
                PCName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
                msgbox "Dear user on " & PCName & vbcrlf & " " & vbcrlf & "This is a message box on top of all other windows.", &h51000, "I am msgbox"
                shell.Open "C:Users"


                Code &h51000 will make sure msgbox in central and on top of all other windows all the time.



                If you only want to schedule a msgbox, you can simply use task scheduler, there is a built in function to schedule a message. see location of [start a program] in task scheduler.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 4 '14 at 11:53









                Root Loop

                3502518




                3502518






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f709725%2fdisplay-message-box-from-task-scheduler-on-top-of-all-other-windows%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    AnyDesk - Fatal Program Failure

                    How to calibrate 16:9 built-in touch-screen to a 4:3 resolution?

                    QoS: MAC-Priority for clients behind a repeater