Windows: Uninstall an Application from the Command Line

Contributor Icon Contributed by Rob Rogers  
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.

 

43 Comments -


  1. Larz said on January 6, 2009

    Great tip. Thank you.

  2. uninstall said on February 1, 2009

    thanx a million times

  3. Javeed said on April 23, 2009

    1. How about those products whose names in the registry are not direct names to search. How about names like HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall{786C4AD1-DCBA-49A6-B0EF-B317A344BD66}

  4. Creature said on April 30, 2009

    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?

  5. Pradeep said on May 28, 2009

    Wow, this truely helped me. Thanks.

  6. David said on June 2, 2009

    This works for XP Pro, but what about one for XP Home?

  7. MadTaffy said on June 15, 2009

    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

  8. Anonymous said on July 21, 2009

    This doesn’t work on WinXP Pro SP3 32bit. Entering “product get name” at the “wmic:rootcli>” prompt gives the following error:

    Code = 0×80041001
    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.

  9. will said on August 6, 2009

    is there a way is assume yes instead of waiting to be prompted?

  10. Anonymous said on September 1, 2009

    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/documentation/windows/xp/all/proddocs/en-us/wmic.mspx?mfr=true

    For options

    Hope this helps!!

  11. blak3r said on September 24, 2009

    wmic:rootcli>product get name
    Node – MyComputerName
    ERROR:
    Code = 0×80041010
    Description = Invalid class
    Facility = WMI

    Shrug

  12. Anonymous said on October 15, 2009

    the command “product get name” is not showing all the installed programes ,then how can i uninstall the desired one .plz send me reply.

  13. Anonymous said on October 15, 2009

    the command product get name is not showing all the programmes then how can i uninstall the desired one send me reply.

  14. Anonymous said on October 22, 2009

    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.

  15. Nag said on October 27, 2009

    I got the following error:
    Node – my system name
    Error:
    code = 0×80041010
    Description = Invalid class
    Facility = WMI

  16. Anonymous said on October 27, 2009

    Can I create a bat file?

  17. kiran said on October 29, 2009

    thanks a lot

  18. Techno said on January 21, 2010

    It doesnt work on my XP sp3 !
    I get a
    Node – machinenamehere
    ERROR:
    Code = 0×80041001
    Description = Generic failure
    Facility = WMI

  19. Omi said on January 26, 2010

    For those who are having problems, please use the following command to uninstall under Windows XP SP3 (it’s working for me):

    wmic
    product “your_program_name” call uninstall /nointeractive

    Also you can run the command directly either on a command console or into a batch file:
    wmic product “your_program_name” call uninstall /nointeractive

    NOTE: /nointeractive bypass Y/N prompt assumming YES

    Hope it works for you!

  20. Anonymous said on April 17, 2010

    Does this also work on Vista Home basic? I bought CSI deadly intent,and it wont play because d3dx9_41.dll cannot it be found. it says reinstalling should fix it,but the problem is , it wont uninstall from control panel ,,so I hope this works for vista too…if not,if anyone knows could you please let me know how,,I would really appreciate it.

    jen

  21. Roushan said on May 21, 2010

    thank you very much..i fixed my bluescreen prob using that :)

  22. Eric said on June 28, 2010

    Does this work in Windows 7?

  23. ml said on June 30, 2010

    very useful

  24. Asdlfkj said on July 6, 2010

    Yes

  25. Gjbedi said on July 15, 2010

    Not working for WINDOWS 2003 R2

  26. Gjbedi said on July 15, 2010

    Not working for WINDOWS 2003 SP2

  27. Nagaraju Vasamsetty said on July 18, 2010

    excellent

  28. Marcoapdealmeida said on October 6, 2010

    I just want to replace a windows xp pro from my pc and install a home edition, however I haven got only cds for the home edition and the xp pro doesn’t allow the home edition to take control in the boot. When trying format on the command line, the setup response is that is not possible because there are processes running. Any suggestion?

  29. Deeprothan87 said on October 14, 2010

    Not working

    Kuldeep Singh

  30. Adham da great said on October 15, 2010

    thanks

  31. Love said on October 28, 2010

    use again

  32. Dbritton said on December 15, 2010

    Try running the command prompt as a user who is a local adminstrator. This worked for me when I encountered the same problem.

  33. Rudyguerrero48 said on December 19, 2010

    thank u very much! works very well

  34. Petey said on January 10, 2011

    Looks really useful, however the problem program for me does not appear in the list of installed programs; does this mean that it is not actually installed and can therefore just be deleted. It is PC Mighty Max 2007 – it is less than a MB but after trying to access it to find an uninstall facility it became very disruptive, popping up and using memory and generally being a real pain.

  35. Anil said on February 14, 2011

    How to write this in batch file

  36. Fd said on March 23, 2011

    just type in C:

  37. Anon19 said on April 4, 2011

    For the people that seem to be having issues with running this, the WMI command needs the latest .net framework to be installed. Check windows update, and make sure you have the latest updates installed.

  38. Sonylaptopfrank said on April 15, 2011

    hello,

    i cannot start my windows 7 in safe more or use recovery function, what can i do ?

    problem happened after windows 7 update, then after restart windows defender asked me to restart again, and then blue screen or auto restart forever.

    i would like to disable or uninstall windows defender as i can access the command prompt but i can’t find how to do ?

    And do you know how to uninstall windows latest update with command prompt ?

    Thanks for help.

  39. Madhurao1983 said on April 21, 2011

    How to Uninstall patch from command line

  40. Dd said on May 25, 2011

    to uninstall an MSI >>>  “/c msiExec /uninstall c:nstaller.msi /quiet”
    for exe ….    /uninstall c:Installer.exe

  41. Andreas said on December 13, 2011

    This saved me a ton of work.

    Thanks!

  42. Mahesh C said on January 3, 2012

    It works great ! on my XP sp3

  43. Oz said on January 24, 2012

    this is great, but how can I stop the computer from doing a reboot after I uninstall?

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -