Forum Discussion
pjaudrey
14 years agoOccasional Contributor
Hi David,
Yes I had tried that below code which is posted from Du Tran and I am getting error:-
If Not p.Exists Then
Call Log.Error("The 'Add or remove programs' dialog was not found")
Sub SelectApplicationFromControlPanel()
Dim WshShell, oExec, p, w, applicationWnd
Dim button, applicationName, buttonName, programsList
applicationName = "APPLICATION_NAME"
buttonName = "Uninstall*"
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("RunDll32.exe shell32.dll,"&_
"Control_RunDLL appwiz.cpl,,0")
BuiltIn.Delay(10000)
Sys.Process("Explorer").Refresh()
Set p = Sys.Process("Explorer").FindChild("WndCaption", "Control Panel\Programs\Programs and Features")
If Not p.Exists Then
Call Log.Error("The 'Add or remove programs' dialog was not found")
Else
Set programsList = p.FindChild("WndClass", "SysListView32", 20)
Log.Message(p.FullName)
Call programsList.ClickItem(applicationName, 0)
Dim propArray(1)
propArray(0) = "Caption"
propArray(1) = "ObjectType"
Dim valuesArray(1)
valuesArray(0) = buttonName
valuesArray(1) = "Button"
Set button = p.FindChild(propArray, valuesArray, 20)
Call button.Click()
'Insert Uninstall Code Here
p.Close()
End If
End Sub
Audrey
Yes I had tried that below code which is posted from Du Tran and I am getting error:-
If Not p.Exists Then
Call Log.Error("The 'Add or remove programs' dialog was not found")
Sub SelectApplicationFromControlPanel()
Dim WshShell, oExec, p, w, applicationWnd
Dim button, applicationName, buttonName, programsList
applicationName = "APPLICATION_NAME"
buttonName = "Uninstall*"
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("RunDll32.exe shell32.dll,"&_
"Control_RunDLL appwiz.cpl,,0")
BuiltIn.Delay(10000)
Sys.Process("Explorer").Refresh()
Set p = Sys.Process("Explorer").FindChild("WndCaption", "Control Panel\Programs\Programs and Features")
If Not p.Exists Then
Call Log.Error("The 'Add or remove programs' dialog was not found")
Else
Set programsList = p.FindChild("WndClass", "SysListView32", 20)
Log.Message(p.FullName)
Call programsList.ClickItem(applicationName, 0)
Dim propArray(1)
propArray(0) = "Caption"
propArray(1) = "ObjectType"
Dim valuesArray(1)
valuesArray(0) = buttonName
valuesArray(1) = "Button"
Set button = p.FindChild(propArray, valuesArray, 20)
Call button.Click()
'Insert Uninstall Code Here
p.Close()
End If
End Sub
Audrey
Related Content
- 3 years ago
- 5 months ago
Recent Discussions
- 4 days ago
- 4 days ago