JSI Tip 10524. Microsoft cumulative updates are not installed correctly if you change the location of the Program Files folder?

Jerold Schulman

May 25, 2006

1 Min Read
ITPro Today logo in a gray background | ITPro Today


If you modify the ProgramFilesDir data value, Microsoft cumulative updates are not installed correctly.

This behavior affects the MSxx-xxx cumulative updates, like MS06-006.

To workaround this problem, I have scripted CumUpdate.bat to reset the default just before installing a cumulative update, and to set it back to your value after the update is installed.

The syntax for using CumUpdate.bat, both before and after an update, is:

CumUpdate

CumUpdate.bat contains:

@echo offsetlocalif exist %SystemDrive%YourProgramFilesDir.reg goto afterUpdregedit /a "%TEMP%YourProgramFilesDir.reg" HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentversion@echo.REGEDIT4>%SystemDrive%YourProgramFilesDir.reg@echo.>>%SystemDrive%YourProgramFilesDir.reg@echo.[HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentversion]>>%SystemDrive%YourProgramFilesDir.regset f1=find /i "ProgramFilesDir"set f2=find "="for /f "Tokens=*" %%i in ('type "%TEMP%YourProgramFilesDir.reg"^|%f1%^|%f2%') do (  @echo.%%i>>%SystemDrive%YourProgramFilesDir.reg @echo Your %%i)@echo.>>%SystemDrive%YourProgramFilesDir.reg@echo.>>%SystemDrive%YourProgramFilesDir.regdel /q "%TEMP%YourProgramFilesDir.reg"@echo.REGEDIT4>%SystemDrive%DefaultProgramFilesDir.reg@echo.>>%SystemDrive%DefaultProgramFilesDir.reg@echo.[HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentversion]>>%SystemDrive%DefaultProgramFilesDir.reg@echo."ProgramFilesDir"="%SystemDrive%\Program Files">>%SystemDrive%DefaultProgramFilesDir.reg@echo Default "ProgramFilesDir"="%SystemDrive%\Program Files"@echo.>>%SystemDrive%DefaultProgramFilesDir.reg@echo.>>%SystemDrive%DefaultProgramFilesDir.regregedit /s %SystemDrive%DefaultProgramFilesDir.regdel /q %SystemDrive%DefaultProgramFilesDir.regendlocalgoto :EOF:afterUpdtype %SystemDrive%YourProgramFilesDir.regregedit /s %SystemDrive%YourProgramFilesDir.regdel /q %SystemDrive%YourProgramFilesDir.reg



Read more about:

Microsoft
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like