Installing windows updates manually and quickly installing them!

When you have a new install of windows or have many computers to install windows on it can be an arduous task to get get those computers up to date with the method provided by microsoft. ie to install and download updates onto each computer.

You can however speed the process up with a bit of downloading magic and an easy script I wrote.

First you need to get updates you can download them individually from the windows catalog https://catalog.update.microsoft.com or a better method is to use windows update downloader

a video on how to use it to download your updates.

ok so you’ve got all your files downloaded but the problem is you have to install each on manually?

This is where a bit of scripting magic comes in handy.

Heres the Script!

 

@echo off
Echo Compiled By xtextedx:)
for /f %%A in (‘DIR /s /b “*.msu”‘) do (
echo Installing Updates “%%A” …
timeout /t 5
start /wait %%A /quiet /norestart > nul
)
echo.
echo ###########################################################
echo.
echo Updates installed
echo Press any key to restart
pause >NUL
shutdown -r -t 0

 

Just put this script in a text file and rename it .bat

This script will loop over any directory in the current folder and install any .msu file.then wait 5 seconds before moving onto the next file and folder – if you need to install .exe or some other extension just change the .msu to .exe etc.

now put your newly made .bat file into your downloaded update directory

.bat file in folder

next you’ll want to open cmd.

open cmd

With cmd you’ll want to run as administrator by right clicking on the icon and right clicking again and clicking on run as administrator

right click to run as administrator

Next you need to navigate to your directory by using the change directory command and you can highlight your current directory from the windows explorer bar.

cd to current directory

So the command will be  cd  C:\Users\007\Desktop\wincatalog in my case.

and finally you just need to call your script I called mine updatescript.bat and press enter the script will install all your updates one by one and when its finish you can press a key to shutdown.

windowsupdatescript

You may need to make sure there are no spaces in your file names you can fix this with

my other script to rename spaces with underscores used in the same way just put in the directory and run the script.

@echo off
setlocal
for /F “delims=” %%A in (‘dir /b /s “* *.*”‘) do call :sub “%%A”
goto :eof

:sub
set “_fn=%~nx1”
ren %1 “%_fn: =_%” >> C:\results.txt

Hope you can update quickly and offline!

Any question just comment.

 

 

 

Read More