Re: Service sort in VBscript
- From: mishkare@xxxxxxxxx
- Date: 28 Oct 2006 19:43:17 -0700
Oh nevermind.
I just changed Win32_ApplicationService to Win32_Service and it works
just fine!
Thank you very much!
mishkare@xxxxxxxxx wrote:
This works great on my XP workstation but when I try it on a 2003
server I get an error in line 6
...For Each obj_Service in obj_Services
Any ideas?
Its me Earnest T. wrote:
Dim str_Services
Dim obj_WMI, obj_Services, obj_Service
Set obj_WMI = GetObject("winmgmts:\\.\root\cimv2")
Set obj_Services = obj_WMI.ExecQuery("Select * from
Win32_ApplicationService WHERE Name LIKE '%" & "GECS" & "%'",,48)
For Each obj_Service in obj_Services
str_Services = str_Services & obj_Service.Name & ", " &
obj_Service.Description & vbcrlf
Next
msgBox str_Services
Bryan Martin
<mishkare@xxxxxxxxx> wrote in message
news:1162029583.616805.83560@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am trying to write a script to examine all the services on a machine
and return only the services that contain "GECS" in the name and I am
having trouble understanding how the For ...each statement could be
used for this.
I have seen a lot of examples that will list all the services or 1
named service.
But, I can't do anything like this with out an error
...For Each objItem in colItems
If instr(objitem,"GECS") then ...
I appreciate the help.
.
- References:
- Service sort in VBscript
- From: mishkare
- Re: Service sort in VBscript
- From: Its me Earnest T.
- Re: Service sort in VBscript
- From: mishkare
- Service sort in VBscript
- Prev by Date: Re: CreateObject confusion
- Next by Date: Re: CreateObject confusion
- Previous by thread: Re: Service sort in VBscript
- Next by thread: Re: OpenSchema error
- Index(es):
Relevant Pages
|