Microsoft has published a command shell script, which will add and set a registry key on the computer so that Windows Update, Microsoft Update or Automatic Updates will offer the Windows Vista and Windows Server 2008 the Service Pack 2 (KB version 948465) beta build 6002.16497. The registry key hack that given officially by Microsoft is slightly different from the previously used registry key (for leaked build 16497), although both registry keys will direct Windows Update to install the exact same build version number of 6002.16497.081017-1605.

The batch command script is published as part of CPP (Customer Preview Program) Windows Update Experience Kit, together with standalone SP2 ISO and executable for public. To successfully apply the registry hack and then download and install the SP2, users will need to install Service Pack 1 (for Windows Vista only, as Windows Server 2008 is released with SP1 built-in), a prerequisite for installing Service Pack 2.

Download SP2CPPRK.cmd.remove

To run the script, delete the .remove extension from the file name, and then run the script as administrator to merge the necessary registry value. For users who have installed any previous versions of SP2 beta, the old build will have to be uninstalled first.

After merging the registry key, users can wait for Automatic Update to automatically detect and offer the SP2 beta, or manually go to Windows Update to check for updates and start the downloading and installation immediately. Up to two prerequisite package may be offered before users are able to install Service Pack 2 beta:

1. KB955430– This is an update to the “Servicing Stack” or the Windows Server 2008/Windows Vista component installer technologies built into Windows Server 2008/Windows Vista. This update enables the built-in installer to properly and successfully install the service pack itself. This package is not uninstallable but does support build to build upgrades.

2. Optional KB958794 – CEIP Settings update. This package updates some of the CEIP data around device install as part of the service pack install experience. You can remove this update via the ‘Add/Remove’ programs page. You will need to select “show updates” and then can select “uninstall” for KB958794.

Do note that Windows Server 2008 SP2/Windows Vista SP2 Beta is time-limited software, which will expire on May 1st, 2010. Of course, the final RTM version of Windows Vista and Windows Server 2008 SP2 will come out long before the beta expiry date, scheduled to be first half of 2009.

Alternative Method: Copy and paste the following code to a text editor, and save as a file with .cmd extension will do the same trick as downloading from Microsoft Download Center.

@echo off

reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\VistaSP2 /f > NUL 2>&1
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\WindowsUpdate\VistaSP2 /f > NUL 2>&1

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\VistaSP2 /v Beta1 /t REG_SZ /d 93F7D954-DF91-22E6-99AB-4D8AF54E813A /f
IF NOT %errorlevel% == 0 ( goto ERROR)

:SUCCESS
@echo.
echo ===========================================================
echo Windows Server 2008 SP2 Beta and Windows Vista SP2 Beta
echo registry key has been set successfully.
echo If you start SP2 installation, Microsoft will collect
echo information online about the installation process.
echo To install SP2 please check for updates in Windows Update.
echo ===========================================================
@echo.
goto END

:ERROR
@echo.
echo ===========================================================
echo FAILED to set Windows Server/Vista SP2 registry keys.
echo Please run this script by right clicking and selecting
echo "Run as Administrator".
echo ===========================================================
@echo.
goto END

:END
pause

Update: Download Windows Vista SP2 RC-Escrow Build 6002.16659