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
I'm getting an error message at the For.. Next loop. As in the section coloured blue runs well, but when I try to iterate through the items in the ClassCollection collection, that's where I get a message saying "Microsoft VBScript runtime error: Permission denied". I know it has to do with permissions, but what object/system user needs to be granted permission to what exactly? My user account that I use has admin priviledges and I run Windows XP SP3.
Thanks in advance,
Me.
--
Be kind to your dentist - he has fillings too...