Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I found on our site this solution but that is not fully automatically - i.e. I call 1) Windows Updates, then 2) Restart, then 3) Log in, then do the boring loop 1-2-3 again and again manually.

I seek for automation this tendering process! Any ideas please share.

Thank you

share|improve this question
    
Is there a reason the automatic update process will not work for you? Are you simply trying to do it more quickly than theautomated process? –  Dave M Mar 19 '12 at 15:56
    
@DaveM I state it in my post above. I feel annoyed when the OS require me to restart in the middle of my work. I would rather wait it finish its updating loop than be interrupted while working –  Nam G VU Mar 21 '12 at 7:14

3 Answers 3

up vote 4 down vote accepted

Schedule the following command to be run on startup:

  • wuauclt /detectnow

And go into Windows Udpate and change the settings to say Download and install updates automatically, then you should be able to start Windows Update manually and go away. After the update is completed it'll reboot, after the restart it'll go look for more updates.

If necessary, disable your account password until all of the updates have been applied, and then re-apply the password once you're all set.

share|improve this answer
    
One potential downside is that if an update fails each time it runs, it may keep trying to rerun that particular update over and over again, locking the computer in a loop. –  BBlake Mar 19 '12 at 18:05
    
On the other hand, any other possible solution would stop trying to update the machine before all updates are installed. You can only have one or the other. –  SecurityMatt Mar 19 '12 at 18:31
    
@SecurityMatt My question is how can the system auto restart after it completes update? Is that because of the Download and install updates automatically setting? –  Nam G VU Feb 23 at 18:54

I found on our site this solution but that is not fully automatically - i.e. I call 1) Windows Updates, then 2) Restart, then 3) Log in, then do the boring loop 1-2-3 again and again manually.

You could also use the freeware tool Wuinstall. With that you can automate the updating process. For example you can configure wuinstall to install updates until a reboot is needed. Then the tool restarts the system and continues with installing further updates, if there are some left. So you get your system much more faster up to date than using the normal Windows update service.

One potential downside is that if an update fails each time it runs, it may keep trying to rerun that particular update over and over again, locking the computer in a loop.

To prevent getting stuck in an infinite reboot loop you can set the maximum number of reboots. For example after three times of rebooting, the tool will interrupt the updating process.

I used this tool to set up several fresh installed computers and it worked well.

share|improve this answer
    
This is awesome ^^ I'll try Wuinstall and back with you later. –  Nam G VU Feb 23 at 18:56

I just put this together, it seems to work pretty well:

wuauclt /detectnow
wuauclt /updatenow

:CheckForRequiredRestart
    reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" > nul && shutdown -r -t 0
    ping 127.0.0.1 -n 61 > nul
goto CheckForRequiredRestart

Just throw it in a .cmd file and drop it in Startup folder and run it once.

(I'm not really clear on what OS's support the /updatenow parameter but it does seem to have an effect on Windows 7.)

I tested patching a Windows 7 VM and it went through the entire sequence (something like 10 restarts?). The only patches that remained were the Malicious Removal Tool (which requires user approval) and 4 updates that are unchecked by default. They are small though, after installing there was a restart and then a couple patches on top and it was done.

It doesn't install optional updates so there were a few of those, small. I installed them manually and there weren't even any patches on top, so all-in-all it was pretty effective for a simple script. When it finally finishes you simply delete the script. I don't know a simple way to detect a complete finish or I'd have it remove/unschedule itself.


I really don't like WuInstall or the VBS/PowerShell scripts floating around as they are all forced to deal with advanced categorical selection of updates that is too complex for this simple goal. There's no simplicity like "Important", "Recommended", and "Optional"; you have to explicitly exclude languages and/or include many different categories and even then it's not quite the same as what you achieve through the traditional install/restart cycle.

To patch more than just the odd system you should of course use a different method, such as deploying an image with WDS, using a slipstreamed install, WSUS, or WSUS Offline Update.

share|improve this answer
    
Thanks you! This is awesome! –  Nam G VU Feb 23 at 18:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.