wmi - VBScript to uninstall a Windows 7 application -
i attempting write script uninstall program when run. problem program not have exact same name each time, have version number attached. there anyway grab program name list, assuming contains i'm looking for? use name finish uninstall?
the uninstall function i've found is:
strcomputer = "." set objwmiservice = getobject("winmgmts:" _ & "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2") set colsoftware = objwmiservice.execquery _ ("select * win32_product name = 'personnel database'") each objsoftware in colsoftware objsoftware.uninstall() next
you can use like
operator instead of =
in query test product name against pattern, this:
set colsoftware = objwmiservice.execquery _ ("select * win32_product name '%personnel database%'")
Comments
Post a Comment