[Article] Updating XP SP2 and 2003 SP1 Without using Windows Update
You may dislike using Windows Update. I personally dislike the idea of running things on my computer that connect to the Microsoft web site. You may also have difficulties using it these days since The Genuine Validation Advantage program was introduced. Or you may have computers that are not connected to the Internet. In addition, you may like to actually keep hold of an update so you don’t have to waste time down-loading it again next time. So if you fit in any of these categories, then this may help.
How do you know what updates to get? And where do you get them from. This is the tricky bit. MS does provide a way for Administrators to get updates which can be applied off-line, but they don’t make it terribly easy to figure out what ones you need. However you are in luck because it turns out that ben.run has already figured out what you need and is going to provide some useful links.
Note: Before we start I am assuming you are using Windows XP SP2 or Windows 2003 SP1. If you are not using these service packs then go and apply them now.
Windows XP Service Pack 2 Download
Windows 2003 Service Pack 1 Download
Now you will have the service pack for ever if you need to reinstall. To run the Service Pack just double click the .exe file and say yes. You will need to reboot when finished.
Okay now you want to be fully uptodate. Well as of today (10–September-2005) there are 32 updates for XP SP2 and 13 for 2003. Note: I am expecting MS to release new hot-fixes any day now, so this article will be updated and reposted when that happens.
First you need to download them all. However to run them all one by one is very tedious as each one requires things to be clicked. However this can be scripted so you only need to run one thing and it will see what ones are currently not installed and will install them in one go. I have a script for this which I’ll get to soon. But right now lets make sure you get the files. Now you find all these files based on their KB numbers from Microsoft, but that is tedious. So I have done the tedious work for you and provided direct links to the files on the Microsoft site. Note however the URLs contain large sets of numbers in them which Microsoft may change in the future just to be a pain. They work as of now, if they don’t work in the future you’ll just have to use the KB numbers and find them.
32 Critical Updates for Windows XP SP2 to 10–September-2005
KB885250
KB888302
KB885835
KB887472
KB891781
KB888113
KB867282
KB873333
KB890175
KB886185
KB885836
KB873339
KB887742
KB883939
KB890046
KB890859
KB893066
KB893086
KB896358
KB896422
KB896428
KB898461
KB903235
KB901214
KB893803v2
KB896727
KB899587
KB894391
KB899588
KB896423
KB899591
KB893756
13 Critical Updates for Windows 2003 SP1 to 10–September-2005
KB896422
KB896358
KB890046
KB896428
KB883939
KB898792
KB903235
KB901214
KB893756
KB899591
KB899587
KB896727
KB899588
Right now you have all the files for the critical updates. You could run each one individually, but that will be boring. Each one can be called with command line options. I use the options “/passive /norestart /nobackup”. This means don’t ask for interaction but show what is going on, don’t reboot, and don’t bother backing up the old files. You only need to reboot at the very end.
Unfortunately MS has changed the command line parameters. /nobackup used to be /n. You can still use the /n switch on the newer ones though.
So here are the two batch files I have which will apply the hot-fixes. The batch files will check to see if the patch is already installed before running it. This speeds up the process greatly for machines with some of the patches already loaded.
Batch file for installing 32 XP SP2 Hot-fixes.
Copy the text out and call it Setup.bat
@Echo off
rem ////////////////////////////////////////////////////////////////////////////
rem // Setup.bat
rem // This Batch file runs the hotfixes for Windows XP SP2
rem // If the hotfix is already installed (checked by looking for reg key)
rem // then the installation is skipped.
rem ////////////////////////////////////////////////////////////////////////////
if "%~1" == "-p1" set Flags=/passive /norestart /n & goto Process
if "%~1" == "-p2" set Flags=/passive /norestart /nobackup & goto Process
rem ////////////////////////////////////////////////////////////////////////////
set RegKey=HKLM\Software\Microsoft\Updates\Windows XP\SP3
rem ////////////////////////////////////////////////////////////////////////////
rem // Main routine
rem // %1 contains Options
rem //
color 17
title Windows XP SP2 - 32 Hotfixes
echo ::: Installing Updates :::
echo.
call %0 -p1 KB885250 "WindowsXP-KB885250-x86-ENU.exe"
call %0 -p1 KB888302 "WindowsXP-KB888302-x86-ENU.exe"
call %0 -p1 KB885835 "WindowsXP-KB885835-x86-ENU.exe"
call %0 -p1 KB887472 "WindowsXP-KB887472-x86-enu.exe"
call %0 -p1 KB891781 "WindowsXP-KB891781-x86-ENU.exe"
call %0 -p1 KB888113 "WindowsXP-KB888113-x86-ENU.exe"
call %0 -p1 KB867282 "WindowsXP-KB867282-x86-ENU.exe"
call %0 -p1 KB873333 "WindowsXP-KB873333-x86-ENU.exe"
call %0 -p1 KB890175 "WindowsXP-KB890175-x86-ENU.exe"
call %0 -p1 KB886185 "WindowsXP-KB886185-x86-enu.exe"
call %0 -p1 KB885836 "WindowsXP-KB885836-x86-ENU.exe"
call %0 -p1 KB873339 "WindowsXP-KB873339-x86-ENU.exe"
call %0 -p1 KB887742 "WindowsXP-KB887742-x86-ENU.exe"
call %0 -p2 KB883939 "WindowsXP-KB883939-x86-ENU.exe"
call %0 -p2 KB890046 "WindowsXP-KB890046-x86-ENU.exe"
call %0 -p2 KB890859 "WindowsXP-KB890859-x86-ENU.exe"
call %0 -p2 KB893066 "WindowsXP-KB893066-v2-x86-ENU.exe"
call %0 -p2 KB893086 "WindowsXP-KB893086-x86-ENU.exe"
call %0 -p2 KB896358 "WindowsXP-KB896358-x86-ENU.exe"
call %0 -p2 KB896422 "WindowsXP-KB896422-x86-ENU.exe"
call %0 -p2 KB896428 "WindowsXP-KB896428-x86-ENU.exe"
call %0 -p2 KB898461 "WindowsXP-KB898461-x86-ENU.exe"
call %0 -p2 KB903235 "WindowsXP-KB903235-x86-ENU.exe"
call %0 -p2 KB901214 "WindowsXP-KB901214-x86-ENU.exe"
call %0 -p2 KB893803v2 "WindowsInstaller-KB893803-v2-x86.exe"
call %0 -p2 KB896727 "WindowsXP-KB896727-x86-ENU.exe"
call %0 -p2 KB899587 "WindowsXP-KB899587-x86-ENU.exe"
call %0 -p2 KB894391 "WindowsXP-KB894391-x86-ENU.exe"
call %0 -p2 KB899588 "WindowsXP-KB899588-x86-ENU.exe"
call %0 -p2 KB896423 "WindowsXP-KB896423-x86-ENU.exe"
call %0 -p2 KB899591 "WindowsXP-KB899591-x86-ENU.exe"
call %0 -p2 KB893756 "WindowsXP-KB893756-x86-ENU.exe"
echo.
echo ::: Done :::
echo.
pause
goto END
rem ////////////////////////////////////////////////////////////////////////////
rem ////////////////////////////////////////////////////////////////////////////
:Process
rem //
rem // %2 will contain the KB number
rem // %3 will contain the Exe file name
rem // %4 will contain any options passed originaly
rem //
rem //
rem // See if the Reg key exists, this indicates whether patch has already
rem // been installed
rem //
reg query "%RegKey%\%2" > nul 2>&1
if errorlevel 1 goto NeedToInstall
echo %2 - Already Installed. Skipping.
goto EndProcess
:NeedToInstall
echo %2 - Installing
%3 %Flags%
goto EndProcess
:EndProcess
goto END
rem ////////////////////////////////////////////////////////////////////////////
:END
Batch file for installing 13 Windows 2003 SP1 Hotfixes.
Copy the text out and call Setup.bat
@Echo off
rem ////////////////////////////////////////////////////////////////////////////
rem // Setup.bat
rem // This Batch file runs the hotfixes for Windows 2003 SP1
rem // If the hotfix is already installed (checked by looking for reg key)
rem // then the installation is skipped.
rem ////////////////////////////////////////////////////////////////////////////
set Flags=/passive /norestart /nobackup
if "%~1" == "-p" goto Process
rem ////////////////////////////////////////////////////////////////////////////
set RegKey=HKLM\Software\Microsoft\Updates\Windows Server 2003\SP2
rem ////////////////////////////////////////////////////////////////////////////
rem // Main routine
rem // %1 contains Options
rem //
color 17
title Windows Server 2003 SP1 - 13 Hotfixes
echo ::: Installing Updates :::
echo.
call %0 -p KB896422 "WindowsServer2003-KB896422-x86-enu.exe"
call %0 -p KB896358 "WindowsServer2003-KB896358-x86-enu.exe"
call %0 -p KB890046 "WindowsServer2003-KB890046-x86-enu.exe"
call %0 -p KB896428 "WindowsServer2003-KB896428-x86-enu.exe"
call %0 -p KB883939 "WindowsServer2003-KB883939-x86-enu.exe"
call %0 -p KB898792 "WindowsServer2003-KB898792-v2-x86-enu.exe"
call %0 -p KB903235 "WindowsServer2003-KB903235-x86-ENU.exe"
call %0 -p KB901214 "WindowsServer2003-KB901214-x86-ENU.exe"
call %0 -p KB893756 "WindowsServer2003-KB893756-x86-ENU.exe"
call %0 -p KB899591 "WindowsServer2003-KB899591-x86-ENU.exe"
call %0 -p KB899587 "WindowsServer2003-KB899587-x86-ENU.exe"
call %0 -p KB896727 "WindowsServer2003-KB896727-x86-ENU.exe"
call %0 -p KB899588 "WindowsServer2003-KB899588-x86-ENU.exe"
echo.
echo ::: Done :::
echo.
pause
goto END
rem ////////////////////////////////////////////////////////////////////////////
rem ////////////////////////////////////////////////////////////////////////////
:Process
rem //
rem // %2 will contain the KB number
rem // %3 will contain the Exe file name
rem // %4 will contain any options passed originaly
rem //
rem //
rem // See if the Reg key exists, this indicates whether patch has already
rem // been installed
rem //
reg query "%RegKey%\%2" > nul 2>&1
if errorlevel 1 goto NeedToInstall
echo %2 - Already Installed. Skipping.
goto EndProcess
:NeedToInstall
echo %2 - Installing
%3 %Flags%
goto EndProcess
:EndProcess
goto END
rem ////////////////////////////////////////////////////////////////////////////
:END
Now make sure the Setup.bat file is in the same directory as all the Hotfixes files (the .exe files you downloaded). You can simply run the the batch file by clicking on it.
Wrapping it up into one nice package
Now you can put the directory with the hotfixes and the setup.bat file into a self extracting archive. For example I use WinRar. First create a .RAR or .ZIP file of the directory. Then make an SFX with the setup command “Setup.bat”.
So now you have a single .exe file (or two if you made both the 2003 version and the XP version). which you can take to any computer and simply run. This will make sure it has all the updates. The batch file checks to see if it is a hotfix is already installed before attempting to install it.
* Article Update: I have found a better link for KB887742, so the file name does not need renaming.

1 Comments:
Nice one ben that makes life a lot easier for updating my boxes.
Post a Comment
<< Home