4

Is there anyway to stop Windows 7 from executing the forced restart after an update? This is not the restart that happens with Windows Update; this is the forced restart that displays a dialog with "System Restart Required" and provides an unavoidable countdown to restart. I have come to understand these restarts occur because of SCCM and administrator policies. Our sys admins are unlikely to change these policies, so I am looking for other means to better handle the restarts.

While I understand the need for timely updates, in my work environment these updates happen whenever the updates are pushed out, which are usually in the middle of my doing something important. I don't want to stop these updates from happening altogether; I just want to delay or suspend them until I am ready.

Snapman
  • 263
  • 1
  • 2
  • 8
  • 6
    This question appears to be off-topic because it is about policy circumvention. – HopelessN00b Jul 21 '14 at 18:25
  • 6
    Wait...your sysadmins deliberately disrupt everyone's work day? This is not a problem you should be seeking a _technical_ solution to. It needs to be addressed by upper management. – Michael Hampton Jul 21 '14 at 18:45
  • 2
    Are you sure you can't talk to your operations team? Even a goober like me could set up Maintenance Windows in SCCM which would constrain the installation and reboots of Windows Updates to a particular time span. –  Jul 22 '14 at 15:17
  • I asked this question here because a similar question started on Stack Overflow and was routed here. – Snapman Jul 22 '14 at 19:46
  • @Michael Hampton I will give upper management a shot, but technical support is slow to implement low-priority solutions, and I need this to stop now. – Snapman Jul 22 '14 at 20:00
  • @kce I have no problem talking to my operations team, but since I work for a large organization, I would have to submit a service request for myself that would affect every other user in the company. I'll give it a shot, but I'm not getting my hopes up. – Snapman Jul 22 '14 at 20:00
  • @smapman Actually they can setup a Maintenance Window just for you or your workgroup. This shouldn't be an impossible request. –  Jul 22 '14 at 20:28
  • @kce I c. Well, I'll send in a request, we'll see what happens. – Snapman Jul 22 '14 at 20:30
  • @kce: "Maintenance Windows in SCCM which would constrain the installation and reboots of Windows Updates to a particular time span" Yeah, those would be great if they worked, but they don't. 'Business hours'? You can set those all you want, our IT will ignore them. 'Suspend Software Center activities when my computer is in presentation mode'? Good luck. Instead, use Process Explorer to kill SCNotification.exe, then suspend CcmExec.exe. If IT has a policy preventing the latter, try suspending SCNotification. Also, LOG your downtime and present a case to management. – B H Aug 27 '15 at 11:22

1 Answers1

9

If you are in the middle of one of these countdowns, you have no choice but to save your work and let the system reboot. You have to prevent them from happening in the first place by stopping the service responsible for them: the SMS Host Agent service.

Once this service is started, it can't be stopped, even if you are an administrator. When the sys admins push out an update, this service displays the "System Restart Required" dialog and sets the shutdown timer. shutdown /a will not work because there is no shutdown in progress while the countdown is happening (you would have to quickly run shutdown /a when the actual shutdown starts, which you may or may not have the time to do). Killing the dialog window does not kill the shutdown process either.

To stop these types of restarts, you have to hack the update process. The file associated with the SMS Host Agent service is:

CcmExec.exe

which lives in:

C:\Windows\SysWOW64\CCM

You need to rename CcmExec.exe as an administrator to something else (e.g. CcmExec.exe.old), and then reboot your computer; this is the only way to stop the service. Once you've rebooted, the service won't start because it can't find CcmExec.exe. Your computer should now be free of forced restarts. Also, set the startup of the SMS Host Agent service to Manual from Automatic so it doesn't start at boot time.

NOTE: it's a good idea to restart the SMS Host Agent service once you are ready to accept updates. It is NOT a good idea to go indefinitely without system updates, and your sys admins will eventually figure out what you are doing if you go too long without updating.

I have created a couple of batch files that disable and enable the service when run as administrator. The following script renames the executable file and reboots the computer:

ren "C:\Windows\SysWOW64\CCM\CcmExec.exe" "C:\Windows\SysWOW64\CCM\CcmExec.exe.old"
shutdown /r /t 5 /c "System will shutdown in 5 seconds to stop the SMS Host Agent service"
pause

And the following script renames it back and starts the SMS Host Agent service:

ren "C:\Windows\SysWOW64\CCM\CcmExec.exe.old" "C:\Windows\SysWOW64\CCM\CcmExec.exe"
sc start CcmExec
echo "Started SMS Host Agent"
pause
Snapman
  • 263
  • 1
  • 2
  • 8
  • 2
    I realize that part of your issue is not wanting your system to reboot when you're busy, but still - your solution to the issue of reboots is to reboot 3 times as often? – Ward - Reinstate Monica Jul 21 '14 at 21:56
  • Not really -- once the SMS service is not running, reboots will not happen. – Snapman Jul 22 '14 at 19:46
  • 4
    **Update**: For me the CCM executables are located in `C:\Windows\CCM` and I **can** stop the `CcmExec` service ("SMS Agent Host") from the Services tab in Windows Task Manager. – Lilienthal Jan 20 '16 at 11:39
  • 1
    If you're in the middle of a timer countdown, just stop SMS Host Agent service. No need to rename exes, reboots, etc. Just go to Services and stop it. If you don't have permission to stop the service, why would you have permission to rename the exe? It's a possibility if you can't do one to check the other, but likely both will or neither will have permission issues. – Jon Feb 12 '19 at 17:17