The below lines are for VBS script file you can use to uninstall


strComputer = "."


Set objWMIService = GetObject("winmgmts:" _


& "{impersonationLevel=impersonate}!\" & strComputer & "rootcimv2")


Set colSoftware = objWMIService.ExecQuery _


("SELECT * FROM Win32_Product WHERE Vendor = ‘Hewlett-Packard’")


For Each objSoftware in colSoftware





in Line 1 you define variable called strComputer which is the computer you would like to execute this script against, in this case the value is “.” so this means localhost (locally)

Line 2 is to define Variable named objWMIService and to call WMI functions which is defined by winmgmts:

in the background the system loads Wbemdisp.dll which contains the Scripting Library functions

In VBS script they always split the functions in multiple lines although it can be used as one line, anyway

Line 3 which privilege level will be used in access the WMI

impersonationLevel=impersonate then the computer we are connecting to  which is strComputer  variable then the WMI class location "rootcimv2”

Line 4 and 5 is one line but we use _ underscore to allow go to the next line (something like escape character) line 4 we define variable to contain the previously called data plus the function we are interested to call like query the WMI we use ExecQuery function. in line 5 we type our WMI QUERY Language where we select all columns available in class name win32_product and for not displaying all product we can filer the data by using  certain colmn value like name of the product or vendor

SELECT * FROM Win32_Product WHERE Vendor = ‘Hewlett-Packard’


I have to sleep now

lets continue tomorrow

Mahmoud Ibrahim (admin)

About the Author

Mahmoud Ibrahim has technology experience with over 18 years of IT industry. He'd worked in many organizations in many roles and expanded his knowledge across technology stacks, and he is enjoying sharing his expertise whenever possible :).
He is working as a presales expert in Micro Focus serving the international community.

View all posts by Mahmoud Ibrahim (admin)
Previous Article
Next Article