loup001 Posted November 12, 2014 Share Posted November 12, 2014 I am working on an AutoIT script to remove a application from Win7. The application can be removed via Win7 Add/Remove programs, but I need to script the remova, so is there any way to remove the application using AutoIT? Thanks! Link to comment Share on other sites More sharing options...
TheSaint Posted November 12, 2014 Share Posted November 12, 2014 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) Link to comment Share on other sites More sharing options...
Luigi Posted November 12, 2014 Share Posted November 12, 2014 @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 More sharing options...
Moderators JLogan3o13 Posted November 12, 2014 Moderators Share Posted November 12, 2014 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 More sharing options...
Danyfirex Posted November 12, 2014 Share Posted November 12, 2014 Look my signature title="">GetInstalledApps I cant remember well. but I think the method index 6 is Uninstall. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
loup001 Posted November 13, 2014 Author Share Posted November 13, 2014 Thanks everyone - with your suggestions, I was able to use the reg entry and build the removal script. Greta suggestions!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now