Click to See Complete Forum and Search --> : Retrieving System Information: How to Select specific BaseService?


Shaitan00
February 18th, 2005, 10:31 PM
I am currently writing a VBScript which pulls System Information, among this information I am pulling the Windows BaseService data however I do not want to pull it all (over 100, makes for too large result files) so I need to specify which BaseServices I want to collect information about. Currently my code is as follows:

Set colOS = oService.ExecQuery("Select * from Win32_BaseService”)

However this pulls all Win32_BaseServices, I only want to pull the information for a specific service called “AIX Control” (name listed under Windows -> Services)

Can someone help me figure out how this is accomplished? What changes are required to my sql query string so that I can select specific base services?

checksal
February 23rd, 2005, 05:25 PM
Why dont you first do

select top 1 * from Win32_BaseService for xml auto

This will return to you all the column names for the table in xml format. Here you find the column name you wish to put in the where clause and then put it this way:

select * from Win32_BaseService where columnname like '%AIX Control%'

or

select * from Win32_BaseService where columnname = 'AIX Control'