Tuesday, October 20, 2009

Windows Command Line Uninstall

Many thanks to tech-recipes for this tip on uninstalling software from the command line.

I'll next try it using psecec to run it remotely....

To go to WMIC mode, find the software, and uninstall:

1. Open a command prompt.

2. Input WMIC and press Return. You will see a prompt that looks like this:
wmic:root\cli>

3. At the new prompt, execute the following command:
product get name

This will generate a list of installed applications.

4. At the prompt, execute the following command:
product where name="" call uninstall

where application name is the name of the program you wish to uninstall (use the exact name provided by the previously generated list).

For example, if I were wanting to uninstall Adobe Reader 9, my command would look like this:
product where name="Adobe Reader 9" call uninstall
* optionally you can add the switch /nointeractive to bypass the confirmation, so it would look like this:
product where name="Adobe Reader 9" call uninstall /nointeractive

5. When prompted, input y to confirm that you wish to uninstall the application and press Return.

The application will be uninstalled.

No comments: