abort shutdown command does not show any message


  1. Posts : 141
    Windows 10
       #1

    abort shutdown command does not show any message


    I created a shutdown task in task scheduler to e.g. shutdown daily at 12am etc..
    abort shutdown command does not show any message-image.png
    Code:
    C:\Windows\System32\shutdown.exe
    with arguments
    Code:
    /s /t 60 /c "Shutdown in 60 seconds"
    I also added a shortcut in taskbar to abort this
    Code:
    C:\Windows\System32\shutdown.exe /a
    The problem is I would like a message prompt to show that the shutdown has been aborted when clicking the abort shortcut in the taskbar.. just to confirm that the shutdown has been aborted.
    In previous windows 7, the aborted message will automatically pop up in taskbar notification area..
    but in windows 10 there is not such message.
    I tried adding the same /c comment option but it does not work...
    when tested in cmd or by running the shortcut.
    e.g.
    Code:
    C:\Windows\System32\shutdown.exe /a   /c "Shutdown aborted"
    Any solution to this problem?
      My Computer


  2. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #2

    Does the abort message appear if you use an abort shortcut that is not on your Taskbar but, say, on your Desktop?

    Denis
      My Computer


  3. Posts : 2,800
    Windows 7 Pro
       #3

    Hi,

    I would use something along theses lines:
    Code:
    @Echo off
    C:\Windows\System32\shutdown.exe /a
    if %errorlevel%==0 goto success 
    goto faillure
    :success
    C:\Windows\System32\msg.exe YourUserName "Shutdown Aborted !"
    goto Eof
    :Faillure
    C:\Windows\System32\msg.exe YourUserName "No Shutdown in Progress."
      My Computers


  4. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #4

    Malo,

    Msg.exe is no longer included in a standard Windows 10 Home installation.
    I've checked system32 for it on two computers.
    I did find a copy in C:\Windows\WinSxS\amd64_microsoft-windows-t..commandlinetoolsmqq_31bf3856ad364e35_10.0.19041.1_none_df1a7ee54b62a4fd but trying to run that generates a 'This app cannot run on your PC' error. Perhaps it is installed to system32 on amd CPUs?


    All the best,
    Denis

    Home added alter after checking.
      My Computer


  5. Posts : 2,800
    Windows 7 Pro
       #5

    @Try3, I have it present in my 21H2 and tested the cmd before Posting...

    I also have it in my unaltered 21H2 VM...

    abort shutdown command does not show any message-screenshot00213.jpg

    Your installation does not have it ?
      My Computers


  6. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #6

    No, neither of them.

    Oh, hold on. Do you have Pro? All mine are Windows 10 Home.

    I've managed to find corroboration of it being missing from Home -
    Neat Dialog Boxes in Batch Files - Rob van der Woude
    Msg - SS64
    The MSDocs website does not mention this limitation because it only refers to Windows Server msg - MSDocs

    Denis
    Last edited by Try3; 26 Jan 2022 at 15:33.
      My Computer


  7. Posts : 2,800
    Windows 7 Pro
       #7

    ok. Thanks, that explains it...I would have never known, I have All Pro over here.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:24.
Find Us




Windows 10 Forums