none
using PowerShell to uninstall an application using the Product ID or GUID RRS feed

  • Question

  • Hello all,

    I would like to create a PowerShell script to uninstall an application (Malwarebytes). I was able to remove it from a couple of test computers using the command line below. Is there anyway to do this in Powershell? I would like to provide the support desk team with the script to uninstall the app as they encounter it. 

    C:\Program Files (x86)\Malwarebytes' Managed Client\ClientInstallFiles>MsiExec.exe /X{09045BEA-1D64-4496-B0D5-B0021C6D95CA} /qn

    Thanks in advance!

    Phillip 


    Phil Balderos


    • Edited by vPhillip B Tuesday, October 27, 2015 1:22 PM missed entry
    Tuesday, October 27, 2015 1:22 PM

Answers

  • No example needed. Just run the command.


    MsiExec.exe /X {09045BEA-1D64-4496-B0D5-B0021C6D95CA} /qn

    To turn this into a batch file, save the above line as a text file with a .cmd extension.

    Double-click on it to run it.

    That's it.


    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by vPhillip B Tuesday, October 27, 2015 6:22 PM
    Tuesday, October 27, 2015 3:26 PM
    Moderator

All replies

  • Hi Phillip,

    MsiExec runs just fine in PowerShell. Are you having problems with it? If so, what specifically are you running into?


    Tuesday, October 27, 2015 1:28 PM
  • What is wrong with a batch file?  It is only one line.  You can just double click a batch and you can't a PS1 file.


    \_(ツ)_/

    Tuesday, October 27, 2015 1:49 PM
  • Hi Phillip,

    MsiExec runs just fine in PowerShell. Are you having problems with it? If so, what specifically are you running into?


    Hello

    Thanks for the response. So do I just copy the line of code in a text file save as .ps1? Is there anything I need to add to the script besides the line of code I mentioned 

    C:\Program Files (x86)\Malwarebytes' Managed Client\ClientInstallFiles>MsiExec.exe /X{09045BEA-1D64-4496-B0D5-B0021C6D95CA} /qn

    Phil Balderos

    Tuesday, October 27, 2015 2:38 PM
  • What is wrong with a batch file?  It is only one line.  You can just double click a batch and you can't a PS1 file.


    \_(ツ)_/

    Thanks for the response!

    I would like to possibly deploy this in SCCM also. I do understand your point about the batch file. Do you have an example that I can use and test?

    Thanks!


    Phil Balderos

    Tuesday, October 27, 2015 2:40 PM
  • No example needed. Just run the command.


    MsiExec.exe /X {09045BEA-1D64-4496-B0D5-B0021C6D95CA} /qn

    To turn this into a batch file, save the above line as a text file with a .cmd extension.

    Double-click on it to run it.

    That's it.


    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by vPhillip B Tuesday, October 27, 2015 6:22 PM
    Tuesday, October 27, 2015 3:26 PM
    Moderator
  • No example needed. Just run the command.


    MsiExec.exe /X {09045BEA-1D64-4496-B0D5-B0021C6D95CA} /qn

    To turn this into a batch file, save the above line as a text file with a .cmd extension.

    Double-click on it to run it.

    That's it.


    -- Bill Stewart [Bill_Stewart]

    Thanks Bill

    Phil Balderos

    Tuesday, October 27, 2015 6:22 PM