Jump to content

Application Removal via AutoIT


loup001
 Share

Recommended Posts

Sure can, it's an AutoIt thing to do such.

It may be as simple as reading a value in the registry, then using that to run its uninstaller.

Whip up some code, and we will help you through any hurdles you come across.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

@loup001,

if the application you want to remove was written inside some standards and best practices, it will have an uninstall key in the registry... (it's easy)

If not, the application is installed, it works, but how to uninstall is a way so that those who created the program knows.
If the second option, it is difficult to uninstall a program in an automated way.
I'm not on the computer that has the examples of which I speak, will post later.
 
Br, Detefon

Visit my repository

Link to comment
Share on other sites

  • Moderators

If it is in Add/Remove Programs then it has an entry in the registry. Look in the following places:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall (32 bit machines)

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall (64 bit machines)

For 64bit machines, always look in both locations.

Once you find the key for the software you seek, you should see a value for UninstallString. That is what you want to script. For example:

;UninstallString value for Microsoft Visual C++ 2010
;MsiExec.exe /X{196BB40D-1578-3D01-B289-BEFC77A11A1E}

ShellExecuteWait("Msiexec.exe", "/x {196BB40D-1578-3D01-B289-BEFC77A11A1E} /qb") ;Add the /qb switch so you can see progress

Alternatively, you can use WMI:

;Prompt for the name of an application, and then uninstall through WMI

#include <MsgBoxConstants.au3>

$sName = InputBox("Uninstall Wizard", "Please type the first few letters of the application name to search")
$oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & @ComputerName & "\root\cimv2")
$aProducts = $oWMI.ExecQuery("Select * from Win32_Product Where Name LIKE '%" & $sName & "%'")

For $app in $aProducts
    $popup = MsgBox($MB_YESNOCANCEL, "Uninstall Wizard", "Would you like to uninstall " & $app.Name & "?")
        If $popup = $IDYES Then
            $app.Uninstall()
        ElseIf $popup = $IDCANCEL Then
            ExitLoop
        EndIf
Next

This could easily be modified if you would just like to input the name of the application, rather than being prompted for it. It can also be easily modified to allow uninstallation of applications on remote PCs.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Look my signature  title="">GetInstalledApps 

I cant remember well. but I think the method index 6 is Uninstall.

Saludos

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...