Jump to content

Recommended Posts

Posted (edited)

Hello AutoIT Community,

I am working on building an automated uninstaller so that I can quickly uninstall a series of products from test machines as we constantly update our software suite.

What I do not have:

- An uninstall.exe or equivalent file.

What I do have:

- I have access to Programs and Features panel, and can manually uninstall the program through here.

What has not worked so far:

1.) PowerShell(PS) Solution: I wanted to try to open a command prompt and launch PowerShell to query for installed software, and then uninstall it. My program did not appear in the listing.

Here is the PS script I used: get-wmiObject -Class Win32_Product -Filter "SELECT * FROM Win32_Product WHERE NAME like '%myProgram%'"

2.) Run Install Shield: Since I do have an installer file, I wanted to see if re-installing would give me a prompt for reinstalling the program, but it did not.

What has worked(but is not sufficient):

1.) I have one solution that is hacked, and not very reliable.

Run("cmd /c appwiz.cpl ") ; This opens up the "Programs and Features" panel.

WinWaitActive("Programs and Features")

ControlFocus("Programs and Features","","[CLASSNN:SysListView321]") ; This sets focus to the prompt

ControlSend("Programs and Features","","[CLASSNN:SysListView321]","b") ; Send a key to find my program that begins with 'b'

ControlSend("Programs and Features","","[CLASSNN:SysListView321]","e") ; Send another key to find my program which happens to begin with "be"

ControlSend("Programs and Features","","[CLASSNN:SysListView321]","{Enter}") ; Send an enter, so the uninstaller is prompted to run

As you can see from this solution, there could be many programs that have this prefix.

What I have learned so far is that the "Programs and Features" window not a regular window. I have been able to get the hWnd, and limited class information. It appears that there is a listview(SysListView321) that is storing the information.

Any help to run uninstall through command prompt or other ways to send a click or find my targetted program to uninstall would be extremely helpful.

Thank you for your time, let me know if I can assist you further in solving my problem.

Thanks.

Edited by MikeSSSS

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
×
×
  • Create New...