Luckily, there is a simple, easy way to do this without breaking out regedit and potentially typoing your way into an extra few hours of work.
In WindowsXP go to Start menu->Run (or WindowsKey+R) and type in gpedit.msc Windows Update
For Windows 7 and Vista, there are TWO settings that need to be changed.
The first one is "No auto-restart with logged on user for scheduled automatic updates installations" which should be set to "ENABLED"
The second one is "Re-prompt for restart with scheduled installations" which should be set to disabled OR set to a different time.
Keep Up with TechRepublic