Most of the Windows 7 box is configured to do automatic update during mid-night and it will restart your machine.
You may leave your windows 7 running because it is providing services. It might have several VMware guests running on top. A brutal restart by Windows 7 can be horrible.
1 Click the Start menu and type
gpedit.msc
in the search line and press the enter key. This will launch the Local Group Policy Editor.
2
On the left side of Local Group Policy Editor, expand to Computer Configuration > Administrative Templates > Windows Components. Then scroll down and select Windows Update.
3
Double click “No auto-restart with logged on users for scheduled automatic updates installations” option. In the properties window that appears, change the option from “Not Configured” to “Enabled". Click “OK” and close Local Group Policy Editor. Windows will no longer prompt you to restart after automatically installing updates.