Automating Uninstallation of NI Software

Updated Jun 7, 2021

Environment

Software

  • LabVIEW Full

Operating System

  • Windows

This article discusses how to use the NI Software Uninstall tool from the command line to automate the uninstallation of NI software from your computer.

  1. Open the Command Prompt with elevated permissions 
  2. Use the "cd" command to navigate to the directory containing the NI Software Uninstaller tool
    • ​​​​​​32- bit systems: C:\Program Files (x86)\National Instruments\Shared\NIUninstaller\  
    • 64- bit systems: C:\Program Files\National Instruments\Shared\NIUninstaller\
  3. If uninst.exe is not located in either of the above directories, find the correct path where it is stored in the Windows Registry 
    • 32-bit Systems: HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\Common\Installer\MIF\MetaUninstaller\Path
    • 64-bit Systems: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\National Instruments\Common\Installer\MIF\MetaUninstaller\Path
  4. Use uninst.exe to uninstall your software using the commands listed below. You can modify these commands with the command line switches listed below.
    • Command to uninstall all NI Software from your computer: uninst.exe /qb /x all 
    • Command to uninstall specific NI software: uninst.exe /qb /ForceDependents /x "product name" 

Command Line Flags
  • /ForceDependents: 
    • This flag is optional, but recommended. It forces products that depend on the specified product to also be uninstalled. If this flag is not specified when there is other NI software installed on the computer that depends on the specified product, then the uninstall will fail without uninstalling any products. Please be aware that using this flag could result in up to all NI software being installed from your computer.
    • For example, assume you have a system that has the LabVIEW 8.0 Run-time Engine and NI DAQmx 8.0 installed.  You want to remove only the run-time engine, so you use the following command-line: uninst.exe /qb /x “NI LabVIEW Run-Time*” In this scenario, the uninstall will fail and exit immediately, because DAQmx depends upon the LabVIEW Run-time engine. This same behavior occurs in the User Interface mode of the NI Uninstaller, when you are prompted to "Remove All" in the "Dependent Products Detected" dialog. Take advantage of the User Interface mode for discovering dependencies before using this flag to automate uninstallation on multiple computers. 
  • /log: 
    • To create a log of the uninstallation, use the /log logfilename.txt flag.
    • Note that depending on the software being uninstalled, the log file may become very large.

Error Codes 
0ERROR_SUCCESSSuccessful uninstall.All products removed successfully.
3010ERROR_SUCCESS_REBOOT_REQUIREDSuccessful uninstall. At least one product requested a reboot (the reboot is always suppressed).
Any other positive integerFAILUREUninstall failed.

Versions of NI Installers That Support Automated Uninstallation
The flag /qb /x all is supported if there is a product installed on your system that was shipped with NI Installers 2.0 or higher. The remaining flags were added with NI Installers version 2.6 or higher. To learn how to determine the version of your installer, see the related links below (the type is not important in this case). Alternatively, you can check the version of uninst.exe on your system instead of setup.exe on the media. The version of this file will reflect the latest version of NI Installers on your system.


Additional Information

This method will not work for all versions of NI software. If you are unsuccessful in using the NI uninst.exe, as described above, then consider using the command line interface for NI Package Manager to Automate the uninstallation of your NI software. For more information, see How Can I Control NI Package Manager Through the Command Line? .
  • "product name" can be found in the uninst.exe user interface (open uninst.exe from the File Explorer to access)

  • Automated uninstallation does not require any user interaction, but will display a progress dialog.
  • All reboots will be suppressed, and a return code will indicate if a reboot is necessary.
  • For a custom-built installer created with LabVIEW 8.0+, TestStand 3.5+, or CVI 8.0+, the name of the product displayed in Microsoft Add/Remove programs
  • To uninstall multiple products, use multiple /x parameters, such as 
    uninst.exe /qb /ForceDependents /x “NI LabVIEW 8.0” /x “NI-DMM 2.5” The product name is case insensitive, and use quotes around product names that contain spaces.
  • You can use multi-character ("*") and single-character ("?") wildcards for pattern matching in the product name. Note that it will remove all products if there are multiple matches found. For example, /x “NI LabVIEW Run-Time*” would remove 7.1 and 8.0 of the NI LabVIEW Run-time engine if both were installed.
  • When using this command to uninstall a LabVIEW-built application, all software installed along with the LabVIEW-built application will be removed upon uninstallation. If there are remaining NI products installed and nothing depends on them, they will also be uninstalled.