Uninstall desktop application from control panel by VB script
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Uninstall desktop application from control panel by VB script
Sub UninstallApplication(computerName, applicationName)
Dim wmiService, objectsList, ObjService
Set wmiService = GetObject("WinMgmts:{impersonationLevel=impersonate}!\\"& computerName & "\root\cimv2")
Set objectsList = wmiService.ExecQuery("SELECT * FROM Win32_Product " & "WHERE Name='" & applicationName & "'")
For Each ObjService in ObjectsList
ObjService.Uninstall()
Next
End Sub
it works fine for me in windows 7 ; but not for windows 10, i want something similar to work in windows 10.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You really haven't given us any information to work with here. What happens when you try it in Windows 10?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ObjService.Uninstall() returns 1603
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Keep in mind Windows 10 UAC is much different than Windows 7. It could be that Windows 10 UAC is set to a level that does not allow that uninstall. Try adjusting the UAC settings on your Windows 10 box to the lowest setting and try again.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
