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

Article translations Article translations
Article ID: 940410 - View products that this article applies to.
Expand all | Collapse all

On This Page

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.

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
    Collapse this imageExpand this image
    the Start button
    , 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
    Collapse this imageExpand this image
    the Start button
    , 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:
http://msdn.microsoft.com/en-us/library/ms819772.aspx
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:
Package Manager Technical Reference
http://technet.microsoft.com/en-us/library/cc749302.aspx
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

Properties

Article ID: 940410 - Last Review: March 25, 2008 - Revision: 3.4
APPLIES TO
  • Windows Vista Home Basic
  • Windows Vista Home Premium
  • Windows Vista Ultimate
  • Windows Vista Business
  • Windows Vista Enterprise
  • Windows Server 2008 Datacenter without Hyper-V
  • Windows Server 2008 Enterprise without Hyper-V
  • Windows Server 2008 for Itanium-Based Systems
  • Windows Server 2008 Standard without Hyper-V
  • Windows Server 2008 Datacenter
  • Windows Server 2008 Enterprise
  • Windows Server 2008 Standard
  • Windows Web Server 2008
Keywords: 
kbexpertiseadvanced kbexpertiseinter kbhowto kbinfo KB940410

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com