Best practices for uninstalling Windows applications

This article delineates the various methods Datto RMM offers for uninstalling Windows applications.

Method 1: Mass uninstallation via the Software page at either the global or site level

Refer to Software.

Filter for the software application you wish to uninstall and click Uninstall.

This method will perform a silent uninstallation of the application, which is not visible to the end user.

NOTE  The option to uninstall will not be available for certain applications if Datto RMM was unable to resolve the uninstall command from the device’s software registry entries.

Method 2: Single device software uninstallation from the device Software card

Refer to Software in Device Summary.

Filter for the software application you wish to uninstall and click Uninstall.

This method will perform a silent uninstallation of the application, which is not visible to the end user.

NOTE  The option to uninstall will not be available for certain applications if Datto RMM was unable to resolve the uninstall command from the device’s software registry entries.

Method 3: Using an Advanced Software Management policy

For information about Advanced Software Management, refer to Advanced Software Management.

Advanced Software Management provides the option to uninstall Windows software. In a Software Management policy, add the software application from the Advanced Software Management catalog that you wish to uninstall, and select the Uninstall action.

Refer to the following resources for instructions:

Set up the target and apply the policy the same way you would apply a standard Software Management policy.

This method will perform a silent uninstallation of the application, which is not visible to the end user.

Method 4: Using a built-in component

The Uninstall MSI Software [WIN] component, available from the ComStore, will uninstall an MSI-based application from an endpoint. Refer to ComStore.

This component can be run in two modes: a list of user-level applications that can be uninstalled and the actual Uninstall action.

When you run the component against one or more devices, select the mode to execute it in, name the application you wish to remove (available in the software audit information on the Device Summary page), or select Populate user-level MSI Installations to generate a list of user-level (as apposed to system-level) applications that can be uninstalled using this component.

If you select the Populate user-level MSI Installations as an action, the list of applications can be found in the device-level Activities card using the component's StdOut link. Refer to Activities in Device Summary.

Once you have a list of the applications the component can uninstall, copy the name of the application, run the component again on the endpoint making sure you paste the application name in the Program Name field, and select the Uninstall action.

This method will perform a silent uninstallation of the application, which is not visible to the end user.

Method 5: Using a custom component

First, you'll need to connect to a Windows device that has the installed software you wish to remove. Then, open the registry and locate the uninstall command. In the registry editor, navigate to the following location:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

You will see a list of all the applications installed on the endpoint. Locate the application you wish to uninstall. The following example presents uninstallation of PuTTY.

On the right side of the window, locate the UninstallString entry and copy the contents of the string.

EXAMPLE  MsiExec.exe /X{1E0D5689-40F1-4E46-ABBB-EAAC68B5CD89}

You will need to modify this string to make the uninstallation silent to the end user and supress any reboots that may be required to complete the uninstallation. To do so, add two command line switches to the end of the string:

EXAMPLE  MsiExec.exe /X{1E0D5689-40F1-4E46-ABBB-EAAC68B5CD89} /qn

NOTE  For a full list of command line options supported by MSIEXE, type msiexec /? in a command line.

Now that you have the uninstallation command formatted, you can create a new component in Datto RMM. Navigate to Automation > Components > Create Component. Refer to Creating a component.

Enter a name for the component and set the scripting language to Batch. Then, copy your new uninstall string into the Script section.

After saving the component, you can run it as a quick job or a scheduled job against one or more devices or use it as a response component in a monitoring alert. Refer to Quick jobs, Scheduled jobs, and Monitors.

If the application was not installed via an MSI file, it is still possible to create a custom component to uninstall it. Again, you'll need to locate the uninstall string as above. The following example presents uninstallation of Notepad++.

EXAMPLE  This time, the contents of the uninstall string is "C:\Program Files (x86)\Notepad++\uninstall.exe"

To execute a silent uninstallation that does not interrupt the end user or cause the endpoint to automatically restart to complete the uninstallation, check the vendor's website or help files to locate the equivalent quiet switch used for the MSI-based uninstall command.

EXAMPLE  In this case, the Notepad++ help documentation indicates that adding /S to the end of the command line will force a silent uninstallation, so the command line should look like this: "C:\Program Files (x86)\Notepad++\uninstall.exe" /S

NOTE  Remember that if you encounter spaces in a path or file name, you'll need to enclose the command in quotation marks, but any switches need to be added after the closing quotation mark to complete the command line.

Create a new component as previously described, and paste the new uninstall command in the Script section.

The uninstall commands are software specific rather than device specific, so the same command will uninstall that version of the application on multiple devices.

NOTE  You do not have to remote control an endpoint to obtain the uninstall strings from the registry; Datto RMM includes a remote registry editor as part of the Agent Browser tool set. Refer to Agent Browser tools.

It is possible to have 32-bit applications installed on 64-bit operating systems. On a 64-bit operating system, the 32-bit uninstall strings are located here: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

IMPORTANT  As always, make sure you fully understand the effects the scripts and components will have. Test your components to confirm the outcomes are as expected before you apply them to end user devices.