How to run all Windows Updates in one go without human intervention

I'm sure folks have experienced this. You reinstall Windows and then you have continuous cycles of update => reboots => login => update => reboots => login ... just to come to the "latest version". I can't simply check everything I see either, because many updates are visible only after some other updates have been applied.

As a user, I don't care about the internal patch dependency, just "bring me to the latest". In theory, it should be able to update itself via the system account and embark on it's update=>reboot cyclic journey, without ever bothering the human to log-in.

So is there a way to express to Windows a user intention like "Just go on and update whatever, however. Don't bothering me till you have reached the 'latest version' and it's completed"?

EDIT: This is for my personal Windows 8 virtual machine, not a large corporate IT rollout.


Those reboot cycles are necessary, in the end, because some patches have patches have patches (... and so on!). You probably won't get around it without either A) patience or B) shell scripting.

A. Patience

Just set your Windows update schedule to always download and install all updates and use your computer, shutting down and starting up, at your regular schedule. The update service will take care of the rest. Are there particular updates you need and, so, are forcing updates to happen RIGHT NOW?

Or are you just sick of seeing that you have updates and that they're ready for install... then you want to search for how to suppress those messages.

B. Shell Scripting

If you're comfortable with a little bit of Windows shell scripting, via PowerShell, the open source project BoxStarter has something for you.

BoxStarter is for power-users, specifically software developers, who often re-install their OS or are bringing up new machines or virtual environments. It's got a lot of Windows features wrapped up in PowerShell commands. For example, once installed*, you have access to a Windows update command.

Install-WindowsUpdates



`* that's a topic for another question... "how to install PowerShell modules" or "how to install BoxStarter"


Perform instructions below at your own risk: To automate windows update these instructions may or may not work for your system however it appears to work to an extent for Windows 7 as these instructions were tested on Windows 7.

MUST READ: 1. If the step below does not work verify then you are most likely part of a domain and your security policy may not allow you to perform steps below! 2. UAC prompts were also disabled for the duration of the windows updates so the batch files can run without interruption; be careful to restore this to default when done

Caution this step will make your computer less secure, immediately remove this after your computer is completely up to date. Set a reminder for 24 hours later if need be:

1. First you will have to make sure your computer automatically logs into a user. You can do this by clicking start menu, type "netplwiz", press enter or open the wizard, under the users tab, select your username, and un-check "require password", type your password, close this window.

2. Create 3 batch files to start the automated process. (Open notepad paste each code into a separate notepad and perform a save as corresponding_file_name.bat)

One. Save as: any_name.bat then copy this batch file to your startup folder for the user you made auto login. (Click start > All Programs > Startup)

start "" c:\autoupdate1.bat
exit    

Two. Save as: autoupdate1.bat then copy this to C:\ drive

wuauclt /detectnow
wuauclt /updatenow
reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" > nul && shutdown -r -t 0
start "" c:\autoupdate2.bat
exit

Three. Save as: autoupdate2.bat then copy this to C:\ drive

ping 127.0.0.1 -n 61 > nul
start "" c:\autoupdate1.bat
exit

Restart or open the batch file in the startup folder and watch the magic begin!

3. When it is completely done updating just delete the batch files from the startup folder & c:\ drive

Once again follow these instructions at your own risk as it can create an endless loop if you do not know how to stop this process by removing it from the startup folder or going into windows under safe-mode to remove the batch files

Final notes: If you run into issues running the batch files chances are you may have to look up how to disable UAC prompts for your Windows version