'Uninstalls a remote MSI package.'http://vbscriptwmi.uw.hu/ch31lev1sec4.html'get remote computer nameDim sMachinesMachine = InputBox("Computer name?")'get admin credentialsDim sAdminUser, sPasswordsAdminUser = InputBox("Enter the admin user name.")sPassword = InputBox("Enter the users password. ")'get a WMI LocatorDim oLocatorSet oLocator = CreateObject("WbemScripting.SWbemLocator")'connect to remote machineDim oServiceSet oService = oLocator.ConnectServer(sMachine, "root\cimv2", _ sAdminUser, sPassword)'get a list of installed productsDim sMsg, sNameFor Each oProduct in GetObject( _ "winmgmts:{impersonationLevel=impersonate,(Debug)}" _ ).InstancesOf("win32_Product") 'is this the product we want? sMsg = "Product: " & vbCrLf sMsg = sMsg & oProduct.Name sMsg = sMsg & vbCrLf & "Uninstall this product?" If MsgBox(sMsg, 4) = 6 Then sName = oProduct.Name Exit For End IfNext'Get the named packageFor each oProduct in GetObject( _ "winmgmts:{impersonationLevel=impersonate}" _ ).ExecQuery _ ("Select * from Win32_Product where Name='" & sName & "'") 'uninstall it oProduct.Uninstall 'done! MsgBox "Uninstalled " & sNameNext
sMachine = InputBox("Computer name?")
Set oService = oLocator.ConnectServer(sMachine, "root\cimv2", _ sAdminUser, sPassword)
" & sMachine & "\root\cimv2"
For Each oProduct in GetObject( _ "winmgmts:{impersonationLevel=impersonate,(Debug)}!\\" & sMachine & "root\cimv2"_ ).InstancesOf("win32_Product")
For Each oProduct in GetObject( _ "winmgmts:{impersonationLevel=impersonate}!\\" & sMachine & "\root\cimv2" _ ).InstancesOf("win32_Product")