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: 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 :-)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$form = Get-Process |where {$_.mainWindowTItle -like "*Software Center*"} $setPOS = @' [DllImport("user32.dll")] public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); '@ $handle = $form.MainWindowHandle $SetWindowPos = Add-Type -MemberDefinition $setPOS -name WinApiCall -passthru $SetWindowPos::SetWindowPos($handle,-1,0,0,0,0,0x0080) # 0x0080 = SWP_HIDEWINDOW |
Update 2: Above does not work for me anymore. But I found that you can simply stop the service:
- Open Services (run -> services.msc)
- Find “SMS Agent Host”
- 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 is the greatest information that I have ever received!
Judging by your comment, that’s believable.
Mikey,
Judging by yours, I’d say you are a fool
This escalated quickly
Not really. The original comment was in June 2018. The response was 13 months later. Your response was 3.5 years after the last one.
Really, this escalated slowly.
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
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.
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.
To get rid of the popup window just kill the scnotification.exe process.
Awesome this one helped me get rid of pop-up. Thanks.
Saved week-long simulation from crashing with this. Thanks!
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. :/
Thanks for the comment. I have clarified the text.
Thanks a lot this worked. Very helpful!
Works for me thanks ?
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
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)
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.
No. I have something important to do. Really :-)
Long in advance???? More like 1 hour in advance into important, time-sensitive work. Ridiculous.
At least you’re warned… in this case no warning and the morning work goes to another reality…
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
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!
Dear Angry Admin,
I am working hybrid. Today, I am working from home, just got the reboot notification and don’t want to reboot my office computer.
Why? Because if I do so I will be unable to reconnect, thanks to Bitlocker. I would have to call IT and (hopefully) have someone to go to my office computer and enter Bitlocker pin for me.
What is going to happen: I will be back to the office in a couple days and will then reboot my computer.
My advice: learn empathy and see yourself in the users’ shoes when they have to deal with tyrannical admins.
Bug thanks to the author of this blog: running the shell command then stopping the service on Windows 10 worked like a charm.
In my case: it’s a computer in a 911 center that needs to be on 24/7. I’m just a lowly dispatcher frantic to stop this at 3 in the morning.
On a side note: thank you very much for this article.
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.
muchas gracias
Thanks for this, update 2 worked perfectly on my Windows 10. IT only gave me a 2hr warning when I had a whole day of remote work ahead of me.
There is a prominent place in heaven reserved for you.
You save me the work of a month in an important experiment, men you are the best !
Thank you so much for this…..I managed to stop the countdown with 2 minutes to spare after a 15 minute warning. It was like trying to disarm a bomb on a timer….thankfully I managed to save some stuff, but then I thought there must be a way to stop it, and the services thing did the trick.
I suppose I best reboot though so IT can put more spyware or whatever it is they do to stop people being productive out of hours
Really Rik?
If your IT does not communicate when updates are coming and what to expect, then shame on them.
But the idea that your IT is just trying to make you unproductive or harm you is just childish.
If you had ANY idea of just how many vulnerabilities and exploits FOR those are created in just ONE month for Windows systems you would not be quite so snarky about having to apply patches.
You want to know why IT orgs like yours FORCE reboots like this? Because if they don’t folks (probably like you) simply ignore it, or NEVER reboot (just sleep their PC) and leave their assets in a non functional or vulnerable state and then blame IT for it “Not working” or “being too slow”
If you have issues with your IT not explaining timing and behavior of patches, communicate to your leadership about it and stop whining on the internet about it.
I work in a multi-national organization with almost 50,000 employees. Advance notice is not given by our IT department except in rare situations. Not that anyone would pay attention if it was. Usually they schedule updates for end-of-day or weekend, but that doesn’t take into account the long-running compilers and other work that cannot be interrupted for 24-48 hours at a time.
Hoping this works to save my customer’s work.
Thank you, this was a lifesaver. While waiting for a laptop replacement, I could not reboot my laptop or security software the company installed would disable it and leave me completely in the lurch.
Tried all hints, worked in the end for me and saved my day (/evening) – THANKS !!!
You’re a life saver!!! Thank you Dan!
Thank you. Had a large database restore running on a non-prod VM and I’d forgotten about the scheduled patch maintenance occurring near the end of it.
I have the hours set in my computer of when it is suitable to run the updates, which is after hours when it doesn’t matter if I’m at work or not.
I don’t care that these updates are needed or not, I am in the middle of working, you wait for me, not the other way around. I have stuff to do, shutting the computer down in the middle of a phone call with a user is horse poop, and if you think otherwise you’re wrong.
However, I’m fine with doing the updates….after we’re closed. It would be fine if the updates would be ignored if it is during work hours, but it doesn’t pay attention to those settings in software center. Thank you OP.
Feels good to use this information in practice.
Thanks a lot!
I’m not going to stop update for long, but recent (apparently misconfigured) updates in my company went in with 15 minutes notification, kicking some people out in the middle of meeting.
This is gold. I generally have a ton of stuff open with all the context I need to resume work. Opening several instances of Visual Studio, loading up graphics debuggers, folders and configurations takes a good 15-20 minutes, that’s if I remember where I was at. Very annoying.
Old but helpful
should not be the solution for everyone and permanently!
But the lifesaver for special systems (e.g. recording of measurement series over 14+ days).
Yes, our IT registers the updates 72 hours in advance – but 14+ days is something else – unfortunately, individual systems cannot be given a different rule -> but this article has made an exception possible for me.
THANKS