Hi friends,
I am not able to find what is wrong with the below script. please help me in finding out where i went wrong.
If IsArray(arraySoftwareNames) Then
strComputer = getComputerName()
Set myWinManObj = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set softwareCollection = myWinManObj.ExecQuery("Select * from Win32_Product")
MsgBox "query done"
For Each software In softwareCollection
For Each element In arraySoftwareNames
If element = software.Name Then
MsgBox "(" & software.Name & ")" & vbNewLine & "(" & element & ")"
software.Uninstall()
Exit For
End If
Next
Next
Else
basically i am getting the application names from the registry and storing it in an array and then passing it to this function with the argumentarraySoftwareNames. but when i execute the script softwares are not getting uninstalled and no error is also thrown.