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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -