Install Monthly Patches Offline

Every month MS releases patches that most places require you to install, but what do you do when you need to install those patches on machines that NEVER touch the network?

Well there is a solution. You can download the Microsoft monthly ISO located here:

http://support.microsoft.com/kb/913086/en-gb

Ok so this can be a real pain in the rear to run each of these patches manually. Who wants to do that anyway and with Windows 7 and Server 2008 / Server 2008 R2 the old ways of building a bat file no longer work.

But there is still hope. You can now use WUSA.exe. WUSA.exe is built into the OS and is scriptable.

http://support.microsoft.com/kb/934307

I found this wonderful little script a few months ago and have been using it to create a distributable DVD to patch offline systems.

http://social.technet.microsoft.com/wiki/contents/articles/how-to-install-multiple-windows-updates-and-or-hotfixes-in-a-time.aspx.

I’ve made a minor modification so it can be used with other scripts that I am running. to update the systems with other software as well.

Enjoy.

Simply Extract the Contents of the ISO to a folder and put the bat script in the outermost folder then burn the contents to a dvd for distribution.It can be fired from a bat file or called from another executable etc…

 

Install_Monthly_Patches.bat


@echo off
cls
if %PROCESSOR_ARCHITECTURE%==x86 set arch=x86
if %PROCESSOR_ARCHITECTURE%==AMD64 set arch=x64
for /F "tokens=4-5 delims=[.] " %%A in (‘ver’) do set ver=%%A.%%B
set log="C:\Dignostics\Logs\wusa-%date:~-4,4%%date:~-7,2%%date:~-10,2%-%time:~-11,2%%time:~-8,2%%time:~-5,2%.log"
echo.
echo Installing updates
echo.
for /r "%~dp0" %%m in ("Windows%ver%*%arch%*.msu") do (
set msupath=%%m
set msufile=%%~nm
call :wusa
)
echo.
echo Done!
echo.
goto :eof
:wusa
rem echo %msufile%
start /wait "%SystemRoot%\System32\wusa.exe" "%msupath%" /quiet /norestart
echo %msufile% %errorlevel% >> %log%

 

Enjoy

Chris Stauffer <><

email

Written by , Posted .