• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 4. Customizing Office 2003 > Customizing Removal Behavior

Customizing Removal Behavior

When you upgrade to Microsoft Office 2003, the Removal Wizard (Offcln.exe) removes unnecessary or obsolete components from previously installed versions of Office and related applications. The wizard components run behind the scenes during Setup, but you can also run the Removal Wizard on its own.

Both the wizard and the Office Setup program use the same logic and the same text file (OPC file) to detect and remove unneeded or obsolete files and settings from users’ computers. You can determine which previous versions of Office applications are removed by setting options in a transform (MST file). You can also customize the OPC file so that only the files and components that you specify are removed.

On the Resource Kit CD

The Office 2003 Resource Kit includes the same stand-alone Removal Wizard (Offcln.exe) that is included with Office 2003. The Removal Wizard is installed by default when you run the Office Resource Kit Setup program. For more information, see “Office Removal Wizard” in Appendix A, “Toolbox.”

Removal Wizard components (which are used by both the wizard and Setup) include the following files:

  • Offcln.exe Provides the user interface that lets you run the wizard as a stand-alone utility; located in the \Files\Pfiles\MSOffice\Office11 folder on the installation image. The wizard is also available in the Office 2003 Resource Kit.

  • Oclean.dll Used by the stand-alone Removal Wizard and Setup to carry out instructions in the OPC files and clean up the user’s hard disk.

  • Oclncore.opc Global OPC file for Office 2003; located in the \Files\Pfiles\MSOffice\Office11 folder on the installation image. This file specifies files, registry entries, INI file settings, and shortcuts associated with all components in the core English version of Office 2003.

  • Oclnintl.opc Satellite OPC file for each language version of Office 2003; located in the LCID subfolders. Specifies language-specific components, including files, registry entries, INI file settings, and shortcuts.

  • Oclncust.opc Template file for adding additional content to be deleted by the Removal Wizard, including all content that was commented out in previous versions of the wizard; located in the \Files\Pfiles\MSOffice\Office11 folder on the installation image. Modify this file if you want to delete additional files or registry keys.

Removing previous versions during Setup

When users install Office 2003, Setup detects files, settings, and shortcuts from previously installed versions of Office and removes them. When you run Setup in quiet mode (/q), default Setup behavior removes all previous versions of Office applications that are also included in the version of Office 2003 that you are installing.

For example, if you are installing the stand-alone version of Microsoft Office Word 2003 over Microsoft Office XP Professional, only Word 2002 is removed by default during the update process. If you run Setup with a full user interface, users can choose which previous-version applications to remove.


The Setup user interface allows users to keep or remove all previous versions of a particular application. However, you can use the Custom Installation Wizard or stand-alone Removal Wizard to select particular versions to keep or remove. For example, you can keep Word 2000 but remove Word 97.

Setup can detect and remove the following versions of Office and Office-related products:

  • Microsoft Office 95, Office 97, Office 2000, Office XP (including stand-alone applications)

  • Microsoft Outlook 97, Outlook 98, Outlook 2000, Outlook 2002 (does not include Outlook Express)

  • Microsoft FrontPage® 1.1, FrontPage 97, FrontPage 98, FrontPage 2000, FrontPage 2002

  • Microsoft Publisher 95, Publisher 97, Publisher 98, Publisher 2000, Publisher 2002

  • Microsoft Office 2000 and Office XP Multilingual User Interface Packs (MUI Packs)

    MUI Packs are removed by default only if all other Office 2000 or Office XP applications are also being removed. If you are installing MUI Packs or Proofing Tool Kits separately, then Offcln.exe does not run.

  • Obsolete files, including orphaned files, registry settings, Start menu shortcuts, and INI file settings used by any previously installed edition of Office applications


Setup does not remove documents or other user files from the user’s hard disk.

In addition, Setup detects the following products to avoid deleting shared files that overlap with Office:

  • Microsoft Project 95, Project 98, Project 2000, Project 2002

  • Microsoft PhotoDraw® 1, PhotoDraw 2

  • Hagaki 1, Hagaki 2, Hagaki 3, Hagaki 4, Hagaki 5

  • Team Manager 97

  • Bookshelf® 1 (Office 97)


Because Setup recognizes components at the application level, the removal process detects and removes stand-alone versions of applications such as Word and Microsoft Excel. If all the core applications are removed, Setup also removes shared components such as Office Binder and Equation Editor.

Setup also detects the following as candidates for removal:

  • Incompletely installed or uninstalled components that leave unusable files on the hard disk

  • Files that begin with a tilde (~)

Finally, Setup detects and can remove temporary files, which are defined as files found in any of the following folders:

  • Microsoft Windows temporary folder (Windows\Temp or Windows\Tmp)

  • Folders identified by the environment variable %TEMP% or %TMP%

  • Other temporary folders (drive:\Temp or drive:\Tmp); Setup searches every drive on the computer.

Setup removes files according to instructions contained in the global OPC file (Oclncore.opc) plus any language-specific OPC files (Oclnintl.opc) that you add to the LCID subfolders on your installation image.

For example, a user might have a French version of Microsoft Word and an English version of Microsoft Excel. The global OPC file cleans up all components included in the core English version of Office. If you add the Oclnintl.opc file to the 1036 subfolder, then Setup also removes components unique to the French version of Office.

Removing Small Business Tools

Office 2003 does not include the Microsoft Small Business Tools programs (Small Business Customer Manager, Business Planner, Direct Mail Manager, and Financial Manager) that were part of Microsoft Office 2000 Premium Edition. If you are upgrading from Office 2000, Small Business Tools components are not removed by default.

If you want Office 2003 Setup to remove Small Business Tools during the installation, set the following properties on the command line, in Setup.ini, or in a transform:

  • OPCREMOVESBT2000 Setting this property to 1 allows Office 2003 Setup to remove Small Business Tools from users’ computers.

  • OPCREMOVESBTTEXT Setting this property to a string value—for example, “&Small Business Tools"—; adds a check box to the Remove Previous Versions page of Setup so that users can choose to remove Small Business Tools the same way they remove any other previous-version Office application.

Customizing the removal process

There are several ways that you can specify how the Setup program for Office or the Removal Wizard cleans up users’ computers:

  • In the Custom Installation Wizard, specify which Office components to remove on the Remove Previous Versions page.

  • Customize the OPC file used by Setup to include or exclude additional files or registry entries during the removal process. When users run Setup, your custom removal routine runs automatically.

  • Create your own OPC file and run the Removal Wizard with a command-line option that specifies your custom OPC file.

On the Resource Kit CD

The Office 2003 Resource Kit includes the Custom Installation Wizard, which is installed by default when you run the Office Resource Kit Setup program. For more information, see “Custom Installation Wizard” in Appendix A, “Toolbox.”

Customize removal behavior in a transform

You can use the Custom Installation Wizard to customize removal behavior during Office 2003 Setup. On the Remove Previous Versions page of the wizard, you specify exactly which previous versions of each application are removed from users’ computers. In this case, Setup does not display the Remove Previous Versions page to users during the installation—the instructions in the transform are carried out regardless of the display setting.


When you remove previous applications during Setup, the Removal Wizard always runs in safe mode.

Customize the OPC file used by Setup

Setup follows the instructions in the global OPC file and any language-specific OPC files to determine which components to remove. The OPC files identify files, registry entries, INI file entries, and Start menu items that were installed or modified by previously installed versions of Office and Office-related products. The OPC file also contains rules that describe which of these files or entries to remove, where they are located, and under what conditions they can be deleted.

By editing the default OPC file or by creating a custom OPC file, you can specify which components to remove from the users’ computers. You can also use the OPC file to remove non-Office components, such as custom applications. To add components to the removal list, customize the Oclncust.opc file. To exclude components from removal, you must edit the default Oclncore.opc file.

For more information about customizing the OPC files, see “OPC File Syntax” in the Appendix B, “Office 2003 Resource Kit Reference.”

Run the Removal Wizard separately

After Setup removes files and settings from previously installed versions of Office or Office components, other unneeded files might remain on users’ computers. For example, font files and dynamic-link libraries (DLLs) might not be removed. You can run the Removal Wizard as a stand-alone utility to remove all Office-related files from users’ computers.

Situations in which it makes sense to run the Removal Wizard as a stand-alone utility include the following:

  • Before you upgrade to Office 2003, to clean up existing Office-related files.

  • When you stage your upgrade to Office 2003 applications.

    For example, if you upgrade to Word 2003 before upgrading to the rest of Office 2003, you can remove previously installed versions of only Word.

  • When upgrading to Office 2003 replaces the need for a custom application on users’ computers. You can use the wizard to remove the custom application.


You must have administrator rights to run the Removal Wizard. If a user does not have administrator rights, you must log on as an administrator and run the wizard with the proper permissions.

You can run the Removal Wizard in one of three modes, depending on the degree to which you want to clean up users’ hard disks:

  • Aggressive mode Removes all Office-related components, including components shared by more than one Office application. Before installing Office 2003, you might run the wizard in aggressive mode for users who are upgrading from a variety of Office versions. In aggressive mode, the wizard marks all items listed in the OPC file for removal.

  • Safe mode Removes only components that are no longer needed. Components deleted in safe mode are not being used by any application. In safe mode, the wizard marks items listed in the OPC file for removal only if it does not detect a corresponding application.

  • Safe mode with user discretion Runs in safe mode but allows users to select which detected applications to keep and which to delete.


Never run the Removal Wizard in aggressive mode after you install Office 2003. The wizard might remove shared components that are needed by other applications installed on the computer.

The final page of the Removal Wizard lists all files scheduled for removal. This list is accurate for all Office applications from Microsoft Office 97 or earlier. However, because the Removal Wizard relies on Windows Installer to manage removal of files associated with a particular application, the list might be incomplete for Office 2000 and Office XP. This behavior results in a cleaner and safer removal of Office files, even though the list in the Removal Wizard might be incomplete.

Using command-line options with the Removal Wizard

Creating a custom OPC file and running the Removal Wizard with command-line options gives you the greatest amount of flexibility. To run the Removal Wizard with command-line options, click Run on the Start menu, and then type Offcln.exe followed by the command-line options you want.

Removal Wizard command-line options use the following syntax:

Offcln.exe [/a | /s [/q[/r]] [/l][!][logfile]] [directory]

These command-line options are defined in the following table.

/aIndicates aggressive mode; the Removal Wizard removes files associated with all previously installed versions of Office and Office-related applications. When you use this command-line option, the wizard does not allow you to select which files to keep.
/sIndicates safe mode; the Removal Wizard removes only those files for which it does not detect an associated application. When you use this command-line option, the wizard does not allow you to select which files to keep.
/qIndicates quiet mode; the Removal Wizard runs without prompting the user for information or displaying progress indicators. The wizard does not restart the user’s computer; therefore, changes might not be completed until the user restarts the computer.
/rUsed with the /q option to restart the computer automatically if necessary. The user has no opportunity to save files before the computer restarts.
/llogfileGenerates a log with the file name logfile. If no log file name is specified, the Removal Wizard creates a default log file, Offcln11.log, in the current folder of the wizard.
/l! logfileGenerates a log file in the same manner as /l, but the Removal Wizard does not perform the removal process. This option is useful to test the Removal Wizard before running it to remove files.
directorySpecifies the folder that contains the files used by the Removal Wizard: Oclncore.opc, Oclncust.opc, and <LCID>\Oclnintl.opc files. By default, the Removal Wizard searches the same folder that contains Offcln.exe.

For example, you can enter the following command line:

Offcln.exe /a /q /r /l

This command line does the following on users’ computers:

  • Removes all files from previously installed versions of Office (/a)

  • Runs the Removal Wizard without user intervention (/q)

  • Restarts the computer automatically if needed (/r)

  • Creates the default log file (/l)


The Removal Wizard returns a value to indicate whether the wizard ran with any errors. If you create a batch file to run the wizard, you can include code that captures this value. The wizard returns 0 to indicate that no errors occurred; any other value indicates errors.

Running the Removal Wizard with a custom OPC file

When you run the Removal Wizard separately, you can create a custom OPC file that controls the removal process. For example, suppose you want to remove an internal company tool that is being replaced by Office 2003 functionality. The internal tool, Chart.exe, resides on users’ computers in the folder C:\Program Files\Internal\Chart. In addition, the folder contains support files—Chartsub.dll, Chartprt.dat, and Readme.txt. The following procedure shows you how to modify the OPC file to accomplish all these aims.

To modify the Oclncust.opc for a custom removal routine

Create a backup copy of the default Oclncust.opc file.

Open Oclncust.opc in a text editor.

Add the following lines:

[SAFE] “Internal charting tool”

C:\program files\internal\chart\chart.exe

C:\program files\internal\chart\chartsub.dll

C:\program files\internal\chart\chartprt.dat

C:\program files\internal\chart\readme.txt

These entries direct the wizard to always delete files in the [SAFE] section and specify the name and location of the files to delete.

Save and close Oclncust.opc.


Test your customized OPC file on a computer by using the /l! logfile command-line option. This step generates a log of the files that will be deleted by your customized OPC file without actually removing any files.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint