-Go to Start Menu -> Run type “gpedit.msc” and press Enter
-This opens the Group Policy editor
-In this window go to: Computer Configuration -> Administrative Template -> Windows Components -> Windows Update
-Double click on No auto-restart for scheduled Automatic Updates installations
-In the settings window Choose Enabled and click OK
-Close Group Policy Editor
The next time Windows Update updates your system it will not restart the computer automatically, but will notify you that restart is needed in order to finish the installation.
Now for the registry hack way:
-Go to Start Menu -> Run type “regedit” and press Enter
-This opens the Registry Editor (if you are not sure of what you’re doing STOP because you can completely hose your computer if you screw up)
-In this window go to: HKEY_LOCAL_MACHINE -> SOFTWARE -> Policies -> Microsoft -> Windows -> WindowsUpdate -> AU (if this key does not exist you must create it)
-Create a DWORD named NoAutoRebootWithLoggedOnUsers with a value of 1