Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to use Package Manager to uninstall a package in Windows Vista


View products that this article applies to.

Introduction

This article describes how to use Package Manager to uninstall a package in Windows Vista.

Note This article also applies to Windows Server 2008.

↑ Back to the top


More information

To uninstall a package, use one of the following methods. Both methods use the Package Manager tool (Pkgmgr.exe).

For example purposes, these methods assume that you want to uninstall update 929761. These methods also assume that you have installed the Windows6.0-KB929761-x86.msu file to the C:\Temp folder.

Method 1: Modify the .xml file for the package

  1. Click Start
    , type command prompt in the Start Search box, right-click Command Prompt, and then click Run as administrator.
  2. At the command prompt, type the following command:
    expand c:\temp\Windows6.0-KB929761-x86.msu �F: Windows6.0-KB929761-x86.xml c:\temp
  3. Use a text editor to open the .xml file that you extracted in step 2. For example, use Notepad.
  4. In the .xml file, change the <package action="install"> tag to <package action="remove">, and then save the file.
  5. At the command prompt, type the following command:
    start /w pkgmgr /n:c:\temp\Windows6.0-KB929761-x86.xml

Method 2: Use the command line

At the command prompt, run the following command:
start /w pkgmgr /up:package_name
Note You cannot use the /up option together with the /m option. The /m option points Package Manager to the folder in which the package is located. When you use the /up option, the command requires that you use the actual name of the package. This behavior differs from the behavior of the /ip option.

You may want to retrieve the package name and then pass the name to Package Manager to uninstall the package. To do this, follow these steps:
  1. Click Start
    , type command prompt in the Start Search box, right-click Command Prompt, and then click Run as administrator.
  2. At the command prompt, type the following command:
    expand c:\temp\Windows6.0-KB929761-x86.msu �F: Windows6.0-KB929761-x86.xml c:\temp
  3. Use a text editor to open the .xml file that you extracted in step 2. For example, use Notepad.
  4. Find the assemblyidentity tag. Then, note the values of the following attributes:
    • The name attribute
    • The publickeytoken attribute
    • The processArchitecture attribute
    • The version attribute
  5. At a command prompt, type a command that resembles the following:
    start /w pkgmgr /up:name~publickeytoken~processArchitecture~~version
    Note In this command, you combine all the values that you noted in step 4. To do this, you use the following format:
    name~publickeytoken~processArchitecture~~version
    For example, type the following command:
    start /w pkgmgr /up:Package_1_for_KB929761~31bf3856ad364e35~x86~~6.0.0.1
You can use the /up option to uninstall multiple packages. However, you cannot use the /ip option to install multiple package.

How to test the success of the uninstallation

To determine whether the uninstallation was successful, type the following command at a command prompt:
echo %errorlevel%
If the result is 0, the uninstall operation was completed successfully. If the operation is successful, you do not have to restart the computer or perform any additional tasks. If the operation is not successful, you can find information about the error code by searching for it in the Winerror.h file to. For more information about the Winerror.h file, visit the following Web site:Package Manager may return error code 87. This error code indicates that Package Manager has received incorrect parameters. Package Manager may also return error code 3010. This error code indicates that you should restart the computer for the changes to take effect.

You may also want to view the log file. The log file is located in the %windir%\Logs\Cbs\Cbs.log folder.

For more information about Package Manager, visit the following Web site: For more information about how to use the Ocsetup.exe tool to install or to remove Windows optional components in Windows Vista , click the following article number to view the article in the Microsoft Knowledge Base:
936209 How to use the Ocsetup.exe tool to install or to remove Windows optional components in Windows Vista

↑ Back to the top


Keywords: kbexpertiseadvanced, kbexpertiseinter, kbhowto, kbinfo, KB940410

↑ Back to the top

Article Info
Article ID : 940410
Revision : 7
Created on : 3/25/2008
Published on : 3/25/2008
Exists online : False
Views : 724