Hi, I'm not sure if this is the right place to post this because its not web development although it is VBScript, but here we go. At work I'm trying to create a script that will let a user input a list of computers on the network and then a program to uninstall from those computers, and then have the program automatically do that. As of now it just accepts one computer as input, I can worry about a list later. I'm getting this error message when I debug: "Error on line: 11 - Method or data member not found: objSoftware". Here is my code: Code: Dim inputString As String Dim inputProgram As String inputComputer = InputBox("Computer: ") inputProgram = InputBox("Program to be Uninstalled: ") Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & inputComputer & "\root\cimv2") Set colSoftware = objWMIService.ExecQuery ("Select * from Win32_Product Where Name = '" & inputProgram & "'") For Each objSoftware In colSoftware objSoftware.Uninstall() Next I'm new to both For Each loops and VBScript so I'm not quite sure why that would be happening. I'm using LNSS Script Debugger Version 1.0 through GFI 8. If anyone knows a better way to do this or something I should change please let me know. Thanks so much for any help.
I just changed the For Each loop to a For loop: Code: Set length = UBound(colSoftware) For count = 0 To length colSoftware(count).Uninstall() Next And now I get "the parameter is incorrect" as an error. Am I doing something wrong?