+

Search Tips | Advanced Search

Uninstalling IBM MQ using the command line

We can uninstall IBM MQ by running the msiexec command from the command line to remove all currently installed features.


Before starting

Start the uninstalling process by following the steps described in Uninstalling IBM MQ on Windows.

If you no longer require the queue managers that are on the system, delete them by using the IBM MQ Explorer or the dltmqm command.


To start uninstalling, use the msiexec command.

If we are running IBM MQ on Windows with User Account Control (UAC) enabled, we must invoke the silent uninstallation from an elevated command prompt. Elevate a command prompt by using a right-click to start the command prompt and choose Run as administrator.

In all of the examples of commands shown, the variable names used are as follows:

  • installation_name is the name of the installation we want to remove.
  • product_code is the value shown for MSIProdCode in the output of the following command:
    dspmqinst -n installation_name
    
    An example of a product code is {0730749B-080D-4A2E-B63D-85CF09AE0EF0}.
  • response_file is the file that contains the [Response] stanza and the required property = value pairs. For details about how to create a response file, see Create and using a response file for server installation. For details of the parameters we can specify, see Table 1 in Create and using a response file for server installation. This is an example of a simple uninstallation [Response] stanza:
    [Response] REMOVE="ALL"
    


Procedure

To uninstall all IBM MQ features, use one of the following methods:

  • Run the msiexec command with a parameter that calls a response file.

    A response file is an ASCII text file that contains the parameter values that we want to set for the uninstallation. The response file has a format similar to a Windows .ini file, and contains the stanza [Response]. This stanza contains parameters that the msiexec command can use, in the form of property = value pairs. The msiexec command ignores any other stanzas in the file.

    We can set which features to uninstall, and set whether to keep existing queue managers.

    To silently uninstall IBM MQ using a response file, enter the following command:
    msiexec /x {product_code} /l*v "c:\removal.log" /q USEINI="response_file" INSTALLATIONNAME="installation_name"
    
  • Enter one of the following commands on the command line:

    • To invoke an interactive uninstallation giving you the option to remove queue manager data (providing there are no other IBM MQ installations remaining):
      msiexec /x {product_code} /l*v "c:\removal.log" REMOVE="All" INSTALLATIONNAME="installation_name"
      

      If we are running IBM MQ on a Windows system with User Account Control (UAC) enabled, you might see Open File - Security Warning dialog boxes during uninstallation that list International Business Machines Limited as the publisher. Click Run to allow the uninstallation to continue.

    • To invoke a silent uninstallation that does not remove any queue manager data:
      msiexec /x {product_code} /l*v "c:\removal.log" /q REMOVE="All" INSTALLATIONNAME="installation_name"
      
    • To invoke a silent uninstallation and remove any queue manager data (only valid when removing the final server installation):
      msiexec /x {product_code} /l*v "c:\removal.log" /q REMOVE="All" KEEPQMDATA="delete"
      INSTALLATIONNAME="installation_name"
      
    • To monitor the progress of the uninstalling process and not remove any queue manager data:
      msiexec /x {product_code} /l*v "c:\removal.log" INSTALLATIONNAME="installation_name"
      

      If we are running IBM MQ on a Windows system with User Account Control (UAC) enabled, you might see Open File - Security Warning dialog boxes during uninstallation that list International Business Machines Limited as the publisher. Click Run to allow the uninstallation to continue.

    • To invoke a silent uninstallation and not remove any queue manager data:
      msiexec /x {product_code} /l*v "c:\removal.log" /q INSTALLATIONNAME="installation_name"
      


Results

After the command is entered, the command prompt immediately reappears and IBM MQ is uninstalled as a background process. If you entered parameters to produce a log, check this file to see how the uninstallation is progressing. If the uninstallation finishes successfully, you see the message Removal completed successfully in the log file.


What to do next

Complete the steps that you started in Uninstalling IBM MQ on Windows. Parent topic: Uninstalling IBM MQ on Windows

Last updated: 2020-10-04