Uninstall a Program on Windows Using Command Prompt

Here is how you can Uninstall a Program on Windows Using the Command Prompt

Here at ExeFiles, we are big fans of everything that can be done with a few lines of text i.e. through a Command Line Interface. Over the years, we have covered numerous guides on how you can streamline your complete workflow through the use of batch scripts and CLI commands, from scheduling CRON jobs to formatting a drive and a ton of other tasks you can achieve with the use of just text.

Almost every system and administrative task you would want to do with your computer, you can do it with your Command Prompt in just a few lines of instructions.

Today, we are going to cover a guide on how you can uninstall a program using the Command Prompt. Windows has traditionally handled software uninstallations through the Control Panel’s Add or Remove program functionality, which provides a comprehensive list of all the softwares installed on your machine.

Uninstalling Software from Command-Line

Now, we are going to make use of a command-line utility called WMIC or the Windows Management Instrumentation Command-line. It provides a command-line interface for Windows Management Instrumentation (WMI), a set of extensions to the Windows Driver Model.

Accessing WMIC

Here is how you can use it,

  1. Open the Command Prompt in an elevated mode, as shown in the screenshot below. You can also use our guide on opening an application in an elevated mode.
  2. Type the following command and press Enter,
    wmic
  3. Now you have entered the wmic interface, allowing you to directly communicate with this utility.

Get a list of installed softwares

  1. Type the following command to get a list of installed softwares.
    product get name
  2. This will show you a list of all installed softwares on your machine.

Now that you have the exact name of the application you want to uninstall, you can call the uninstall command inside the WMIC utility.

Uninstall a software

  1. Type the following command and press Enter after replacing the <name> placeholder with the name of the application you want to uninstall.
    product where name="<name>" call uninstall
    
    For e.g.
    product where name="Node.js" call uninstall
  2. It will ask you to confirm the uninstall. Type and press Enter.

That’s it.