Automatically update Windows fully

aeinstein picture aeinstein · Apr 24, 2013 · Viewed 72.1k times · Source

I'm working on a project where the goal is to be able to update a windows computer 100%. That means a program or a script that updates windows automatically with no user interaction at all. Ideally a standalone script that can be run from another script.

The reason: I need to update a lot of computers in my line of work. They can be at any patch level and everything from Windows XP to Windows 8. My goal is to start a script, wait/do something else and then find a fully patched computer.

I've solved a lot by finding ZTIWindowsUpdate.wsf in the MDT Task Sequence.

This can be used like this from an admin cmd:

cssript.exe ZTIWindowsUpdate.wsf

My problem so far is that the computer requires a reboot between some of the updates. Probably because of dependencies. ZTIWindowsUpdate.wsf needs to be run as administrator and i can't seem to find a solution to start it as administrator at reboot. Additionally if I get the script to run on startup, how do I stop it, and how do I know when its time to stop it?

Can someone help med with a foolproof solution to this problem?

Thanks!

Answer

ElektroStudios picture ElektroStudios · Apr 24, 2013

Don't need to FULL update a Windows OS, most of the updates are not needed, most updates are not relationated with security and we can survive without they, you need to read the description of each update to understand what changes made. FULLY updating a Windows can be negative point of performance in several scenarios.

All that you need is to download your desired updates, then store it in a folder with this batch script:

@Echo off
For %%# in (*.msu) Do (
    Echo: Installing update: %%#
    Wusa "%%#" /quiet /norestart
)
Echo Windows Update finished.
Pause&Exit

Also you can compress the folder (the updates + the script) into a Self executable with winrar to distribute it as a standalone file.

Info:

Wusa.exe is the Windows Update commandline application.

The files are processed one by one, not all at once.

The quiet switch makes the installation silent.

The norestart switch don't restart after installing the update even if needed.

If a update is installed in the OS then is not installed again, without getting an error window or stopping the execution of the script.

PS: See Wusa /? for more switches.

I hope this helps.

UPDATE:

Another alternative is to download and install ALL the updates with WSUS utility.

http://download.wsusoffline.net/

The updates for Win7 x64 (for example) are stored here: "...\wsusoffline\client\w61-x64\glb"

PS: The "DoUpdate.cmd" batch file in the "CMD" dir of the application is what you need if need to automate the task in "background".

enter image description here