Microsoft KB Archive/940410

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

Article ID: 940410

Article Last Modified on 7/31/2007

-

APPLIES TO


 * Windows Vista Home Basic
 * Windows Vista Home Premium
 * Windows Vista Ultimate
 * Windows Vista Business
 * Windows Vista Enterprise
 * Microsoft Windows Code Name “Longhorn”

-





Beta Information
This article discusses a beta release of a Microsoft product. The information in this article is provided as-is and is subject to change without notice.

No formal product support is available from Microsoft for this beta product. For information about how to obtain support for a beta release, see the documentation that is included with the beta product files, or check the Web location where you downloaded the release.



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
 Click Start, type command prompt in the Start Search box, right-click Command Prompt, and then click Run as administrator. At the command prompt, type the following command:

expand c:\temp\Windows6.0-KB929761-x86.msu –F: Windows6.0-KB929761-x86.xml c:\temp

 Use a text editor to open the .xml file that you extracted in step 2. For example, use Notepad. In the .xml file, change the  tag to , and then save the file. At the command prompt, type the following command:

start /w pkgmgr /n:Windows6.0-KB929761-x86.xml

</li></ol>

Method 2: Use the command line
At the command prompt, run the following command:

start /w pkgmgr /up:

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: <ol> Click Start, type command prompt in the Start Search box, right-click Command Prompt, and then click Run as administrator.</li> At the command prompt, type the following command:

expand c:\temp\Windows6.0-KB929761-x86.msu –F: Windows6.0-KB929761-x86.xml c:\temp

</li> Use a text editor to open the .xml file that you extracted in step 2. For example, use Notepad.</li> Find the assemblyidentity tag. Then, note the values of the following attributes: <ul> The name attribute</li> The publickeytoken attribute</li> The processArchitecture attribute</li> The version attribute</li></ul> </li> At a command prompt, type a command that resembles the following:

start /w pkgmgr /up: ~ ~

Note In this command, you combine all the values that you noted in step 4. To do this, you use the following format:

~ ~

For example, type the following command:

start /w pkgmgr /up:Package_1_for_KB929761~31bf3856ad364e35~x866.0.0.1

</li></ol>

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://msdn2.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://technet2.microsoft.com/WindowsVista/en/library/77bd6146-1dae-4f3f-b172-4aa5fc876bdc1033.mspx?mfr=true

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

Additional query words: PackageManager Pkgmgr

Keywords: kbhowto kbinfo kbexpertiseadvanced kbexpertiseinter KB940410

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.