
Are you using an account that is a member of the local administrators group? 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
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...
_______________________________________________ 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-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ 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