On Fri, Jan 29, 2010 at 10:12 AM, aki <aki275@googlemail.com> wrote:
On Fri, Jan 29, 2010 at 7:50 AM, Simon Mbuthia <simon.mbuthia@gmail.com> wrote:
@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?

 
@Simon, I checked sdk and still cannot find the object you are looking for. What class/object is ' datac ' under? WMI query has 494 classes.  :-)

Further to this, an example that I was working on last year : to enable auto DHCP ( execute WMI )
 
- Class = Win_32NetworkAdapterConfiguration  ( has 41 methods and each method has parameters you can assign )
- Method = "EnableDHCP"
- Instance = index of NIC cards/DUN/PPP, thus code the correct index number.
 
usual for-each loop.....
 
foreach(<variable> in <object>)
{
//statement
}
 
Result : When code script was run, it would enable DHCP.
 
Corrections welcome...