none
Application>Program>Uninstall>Command-Line: Can you use a simple command-line action to uninstall a program?

    Question

  • Background

    I have an application that is installed by using a script (Create directory, copy files). Everything seems to work fine for the "install."

    All that is needed for an uninstall is the command-line rd "Path" /S /Q but it seems the ConfigMngr client doesnt like this command. I listed the start-in as "%windir%\system32" and the command line as "cmd.exe" rd C:\Path /S /Q but nothing ever executes. According to the AppEnforce.log it sees the command but no action is ever taken and it just times out.

    Question

    Is it possible to run a command-line to uninstall a program or should I just create another batch file to handle this?

    Any help is apprecatied.

    Wednesday, October 10, 2012 5:38 PM

Answers

  • Answer

    I found the answer so I will post in case it will help someone else.

    I put this in the command-line and it worked perfectly.

    "C:\Windows\System32\cmd.exe" /C rd C:\Path /S /Q

    Wednesday, October 10, 2012 6:40 PM

All replies

  • Answer

    I found the answer so I will post in case it will help someone else.

    I put this in the command-line and it worked perfectly.

    "C:\Windows\System32\cmd.exe" /C rd C:\Path /S /Q

    Wednesday, October 10, 2012 6:40 PM
  • A command-line is a command-line is a command-line.

    Jason | http://blog.configmgrftw.com

    Wednesday, October 10, 2012 8:28 PM
  • 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="<application name="">" call uninstall</application>

    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.

    Monday, October 15, 2012 6:53 AM
  • I am attempting to use the method described above, but the program I want to uninstall is not a listed product. It does show up in the Programs and Features window and can be uninstalled there. I need to uninstall this program from about 100 machines and would like to automate this process using a batch file, or at least quick command line tool. Any help is appreciated.

    Thanks,

    Donovan

    Tuesday, July 16, 2013 4:00 PM

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


    Win32_Product is evil: http://gregramsey.net/2012/02/20/win32_product-is-evil/

    @Donovan: is the software listed in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall? You might be able to get the uninstall string from that location.


    Torsten Meringer | http://www.mssccmfaq.de

    Tuesday, July 16, 2013 4:19 PM
    Moderator
  • How you uninstall software is entirely up to the vendor of that product -- there simply is no one-size fits all answer. There are certain standards that most products adhere to, but that's simply by convention. If you can't find an uninstall string in WMI or the registry (as pointed out by Torsten), you need to contact the vendor.

    Jason | http://blog.configmgrftw.com

    Tuesday, July 16, 2013 5:36 PM