Stopping Software Center from restarting your computer

IT-departments may require you to restart your computer to complete updates they have pushed out. This is at best annoying, at worst it can ruin your work if you for example have a long running process in progress. (My personal favorite is when the company forced me to restart my computer in the middle of a service window when I was upgrading a system for said company…)

Note: You may want to skip to Update 2 at the bottom for the latest working method.

If your company uses System Center you may recognize the following dialog informing you that Your Computer is About to Restart:

You can’t close this window or ask it to stop the shut down. So what can you do? I’ve seen others talk about shutting down Windows Services. That never worked for me, but I discovered that there was an easy way to stop the process. Simply open a command prompt and type  shutdown /a

This will abort the shutdown:

The countdown window will still be open, but when reaching zero nothing will happen!

Now you can finish your work at your own pace, before restarting your computer.

Note: If it does not work and you get a message that there is no shutdown in progress, try again later. I’m guessing that the shutdown command is not issued until 15-30 minutes before it should go off. Let me know in the comments if it works.

Update: Since the update window is “always on top” and can’t be closed it blocks your view in a pretty annoying way. Luckily we can use a bit of PowerShell and WinAPI to to hack the window properties to hide it :-)

 

Update 2: Above does not work for me anymore. But I found that you can simply stop the service:

  1. Open Services (run -> services.msc)
  2. Find “SMS Agent Host”
  3. Open it and click “Stop”

Also run shutdown -a  to make sure your computer does not restart itself.

The shutdown notification should go away. It might return after a while, but you repeat the steps above over and over.

 

This entry was posted in Tips and tagged , , , , , . Bookmark the permalink.

21 Responses to Stopping Software Center from restarting your computer

  1. James Rinehart says:

    This is the greatest information that I have ever received!

  2. Kakarr0t says:

    are there any instructions on how to actually copy/paste/run the powershell commands to close the annoying software center window? I’m getting an error when I copy and paste each line.

    PS H:\> $form = Get-Process |where {$_.mainWindowTItle -like “*Software Cen
    PS H:\> $setPOS = @’
    >> [DllImport(“user32.dll”)]
    >> public static extern bool SetWindowPos(IntPtr hWnd,
    >> IntPtr hWndInsertAfter,
    >> int X,
    >> int Y,
    >> int cx,
    >> int cy,
    >> uint uFlags);
    >> ‘@
    PS H:\> $handle = $form.MainWindowHandle
    PS H:\> $SetWindowPos = Add-Type -MemberDefinition $setPOS -name WinApiCall
    PS H:\> $SetWindowPos::SetWindowPos($handle,-1,0,0,0,0,0×0080) # 0x0080 = S
    Cannot convert argument “hWnd”, with value: “System.Object[]”, for “SetWind
    convert the “System.Object[]” value of type “System.Object[]” to type “Syst
    At line:1 char:1
    + $SetWindowPos::SetWindowPos($handle,-1,0,0,0,0,0×0080) # 0x0080 = SWP …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument

    • Dan says:

      I was able to copy the text in the article above, and simply paste it into the PowerShell console and run successfully. If it does not work, could try to use PowerShell ISE instead. Paste the text into the editor and press F5 to run. ISE is better at handling copy/paste in my experience.

  3. Shashank Badola says:

    Very useful information. I used it when my machine was about to shut down and my scanner was scanning machines since last 2 days to reach 98%. If my machine would get restarted at that time then whole 2 days efforts would be wasted. Thanks for sharing this information.

  4. Tom says:

    To get rid of the popup window just kill the scnotification.exe process.

  5. Patrick says:

    Saved week-long simulation from crashing with this. Thanks!

  6. Dave says:

    FYI It is a little unclear. In Update 2 you should say to do both: kill SMS Agent Host and execute shutdown -a.

    In the middle of the article you explain this, but at the beginning of the article you say we can skip to Update 2.

    I killed SMS Agent Host and thought I was done. 10 minutes later my computer shut down with no warning. :/

  7. Tom says:

    Thanks a lot this worked. Very helpful!

  8. Brian says:

    Works for me thanks 😊

  9. Martin LG says:

    This worked for me on Windows 8.1:
    To cancel shutdown: shutdown /a
    To close shutdown window: Task Manager -> Host Process for Setting Synchronization -> SMS Agent Host -> Stop

  10. Mac says:

    do{shutdown /a ; stop-service ccmexec ; sleep 1} while (1 -eq 1)

    if you have really annoying admins … this will just loop and stop it over and over. (admin powershell console)

  11. Irritated system admin says:

    Just reboot your darn machine when the IT asks you to, and you won’t have to Google how to stop the restart that you’ve been warned about long in advance, from happening.

    • Irritaded user says:

      No. I have something important to do. Really :-)

    • Irritated user says:

      Long in advance???? More like 1 hour in advance into important, time-sensitive work. Ridiculous.

      • Another Irritated user says:

        At least you’re warned… in this case no warning and the morning work goes to another reality…

      • Reasonable User says:

        Why are you doing something from your personal Windows desktop that is sensitive to disruption in the first place? It should be for Word processing and SSHing to wherever you SHOULD be doing disruption sensitive work

        • Real Sys Admin says:

          Or just maybe you are performing a restore on a Windows Server that has just been rebuilt and shutting down isn’t an option. Thanks for your help OP!

  12. Micky says:

    I work in application support so when a customer has a priority 1 or 2 call with me and I’m on a webex with them a shutdown does not go down very well with the customer. I don’t think our IT department actually consider we have customers to look after. They just get paid by somebody harvesting the money tree in the CEO’s office.

Leave a Reply

Your email address will not be published. Required fields are marked *