Windows: Uninstall an Application from the Command Line

Contributor Icon Contributed by shamanstears Date Icon July 23, 2008  
Tag Icon Tagged: Windows

By using the Windows Instrumentation command-line interface (WMIC), you can easily uninstall an application without having to use the GUI. Once you become familiar with the steps, it will be much faster than having to access the Add/Remove Programs applet in the Control Panel. This Tech-Recipe applies to Windows XP Professional, Windows Vista, Windows Server 2003 and Windows Server 2008.


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

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

The application will be uninstalled.

Previous recipe | Next recipe |
 
  • Larz
    Great tip. Thank you.
  • uninstall
    thanx a million times
  • Javeed
    1. How about those products whose names in the registry are not direct names to search. How about names like HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{786C4AD1-DCBA-49A6-B0EF-B317A344BD66}
  • Creature
    Wow. Cool. I've been wanting to uninstall from command line for so long!
    How about quiet uninstall without typing y every time?
    Is it possible?
  • Pradeep
    Wow, this truely helped me. Thanks.
  • David
    This works for XP Pro, but what about one for XP Home?
  • MadTaffy
    Hi there,

    I was wondering if you could help, my pc wont boot up because of a app. called ready driver plus, i have tried every option i can think of and thats quite a few, like for e.g repair using installation disc, system restore using disc i've even tried using bootrec.exe in the command prompt when using the command prompt fro the reapair option on the installation disc, so i thought i would try to uninstall the program from there but i noticed the command prompt isn't in the C:\ drive its in a X:\Sources mode and the WMIC option you have mentioned doesn't seen to work, so i'm not sure if i need to get to the C:\ drive 1st which i would assume so but i have no idea how to get from this Administrator X:\Sources to the C:\ drive to be able to use the commands WMIC ... etc. so if you know how i do this i would be very very gratefull, many thanks in advance, best regards MadTaffy
  • louis_xyz
    This doesn't work on WinXP Pro SP3 32bit. Entering "product get name" at the "wmic:root\cli>" prompt gives the following error:

    Code = 0x80041001
    Description = Generic failure
    Facility = WMI

    Typing in "/?" to see the list of commands or help, gives me a listing of commands, but it doesn't contain "product". I'm guessing maybe that what causes the error.
  • will
    is there a way is assume yes instead of waiting to be prompted?
  • glens68
    To bypass the yes prompt... as in the above example

    product where name="Adobe Reader 9" call uninstall /nointeractive

    By default its interactive

    See

    http://www.microsoft.com/resources/documentatio...

    For options

    Hope this helps!!
  • blak3r
    wmic:root\cli>product get name
    Node - MyComputerName
    ERROR:
    Code = 0x80041010
    Description = Invalid class
    Facility = WMI

    Shrug
  • 3381654729
    the command "product get name" is not showing all the installed programes ,then how can i uninstall the desired one .plz send me reply.
  • 3381654729
    the command product get name is not showing all the programmes then how can i uninstall the desired one send me reply.
  • maxyclass
    Beautiful. Ever since i started working with cmd, I'v always known it was the final stop for force removals. After uninstalling some programs to free up space, they still run in start-up. I just deleted the shell folders in program files and will carry out the instruction as above just for keeps.
    thanks shamanstears. cheers.
  • Nag
    I got the following error:
    Node - my system name
    Error:
    code = 0x80041010
    Description = Invalid class
    Facility = WMI
  • steve56
    Can I create a bat file?
  • kiran
    thanks a lot
blog comments powered by Disqus