@RAd Yes, it is
@aki, The problem is not with the syntax, but smething to do with permissions. The code is OK because scriptomatic-generated scripts [google scriptomatic] aren't generating any output. Besides, Win32_.... is a collection of objects from which I want to select the ones that begin with 'Datac'. Once I get a list of those objects, then I get attributes of each of those objects such as Name.. etc. Does that make sense?

On 28 January 2010 19:57, aki <aki275@googlemail.com> wrote:


On Thu, Jan 28, 2010 at 6:08 PM, Simon Mbuthia <simon.mbuthia@gmail.com> wrote:
Hi guys,

Any VBS/WMI gurus out there? I'm trying to run a script that'll return a list of all COM objects beginning with the word "datac". So my script looks as below:

Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\.\root\cimv2")

Set ClassCollection = objWMIService.ExecQuery("SELECT * FROM Win32_ClassicCOMClassSetting where Description like 'Datac%'")

For Each item In ClassCollection
    WScript.Echo item.Name

    WScript.Echo item.Description
Next
 
 
@Simon, thnks for the question as it helps understand WMI better. I covered WMI early last year ( with C sharp ) and I can see that the problem is with the Query string : Win32_ClassicCOMClassSetting does not have a property 'Datac%'.
Class Win32_ClassicCOMClassSetting has 26 proproerties such as AppID, Control etc but not what you used.
 
I could be wrong, pls check your select query. :-)
 
 
 

_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science:  http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi:     http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general



--
Be kind to your dentist - he has fillings too...