Thursday, August 14, 2014

UFT - Start Uninstal Wizard from Control Panel

I had a little trouble with this, but here is how it worked for me:

Parameter("ProductName") = "The name of Product from Control Panel"


Dim sApp
Set sApp= CreateObject("Shell.Application")
sApp.ControlPanelItem cstr("appwiz.cpl"'see list here http://www.sqablogs.com/qtp/1105/To+access+control+panel+items.html
set sApp = nothing

Dim i
For i = 0 To Window("Programs and Features").WinListView("WinListView").GetItemsCount-1 Step 1
    If Window("Programs and Features").WinListView("WinListView").GetItem(i) = Parameter("ProductName"Then
        Window("Programs and Features").WinListView("WinListView").Activate(i)  'Activate Doubleclicks on object
        Exit For
    End If
Next

Source: http://www.sqablogs.com/qtp/1105/To+access+control+panel+items.html