Is there anyway to stop Windows 7 from executing the forced restart after an update? [closed]

Solution 1:

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