Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
strComputer = "itportal" objWMIService = GetObject(StrCat("winmgmts:\\" , strComputer , "\root\cimv2")) colServiceList = objWMIService.ExecQuery("Select * from Win32_Service where Name LIKE 'TSM%%' ") ForEach objService in colServiceList Message("Status", StrCat(objService.DisplayName, " ", objService.State)) Next colServiceList = 0 objWMIService = 0 exitI am not sure if I am using the LIKE portion correctly, since a "%" is required after the service name to perform the query. Appreciate your help.
I am using version 2005C
The error I am receiving is:
3131: OleExecute: Not a valid OLE objectfor the line:
Message("Status", StrCat(objService.DisplayName, " ", objService.State))
There is nothing in the wwwbatch.ini file. I am going against a remote system and am able to receive return information if I have the exact service name in the query.
I did test using my local machine versus different remote systems and ONLY on the remote systems am I receiving the error. It seems that a remote system is not providing the object information back when using the LIKE comparison operator.
I have tried different 3 letter constructs and different remote systems, and always get the same error.
AS an alternative you could just query all of the services then use StrIndexWild to search each of the returned service string for the value you are looking for...
Article ID: W17326
File Created: 2007:07:03:14:29:30
Last Updated: 2007:07:03:14:29:30