Another rookie question about ( "Select * from Win32_NetworkAdapter",,48)

  • Thread starter Cary Shultz [A.D. MVP]
  • Start date
C

Cary Shultz [A.D. MVP]

Howdy guys and gals!

Been looking for a couple of days now and not really finding anything
useful.

"Select * from Win32_NetworkAdapter",,48

In the above example what does the ',,48' mean and do? I have seen many
many examples that have this trailing ,,48 and many many examples that do
not. Since I am a rookie at this I am simply asking what it is so that I
can look up all of the possibilities and make sure that my code as crisp and
clean as possible.

Thanks all!

--
Cary W. Shultz
Roanoke, VA 24012
Microsoft Active Directory MVP

http://www.activedirectory-win2000.com
http://www.grouppolicy-win2000.com
 
T

Torgeir Bakken \(MVP\)

Cary said:
Been looking for a couple of days now and not really finding
anything useful.

"Select * from Win32_NetworkAdapter",,48

In the above example what does the ',,48' mean and do? I have
seen many many examples that have this trailing ,,48 and many
many examples that do not. Since I am a rookie at this I am
simply asking what it is so that I can look up all of the
possibilities and make sure that my code as crisp and clean as
possible.
Hi,

The WBEM_FLAG_FORWARD_ONLY combined with the WBEM_FLAG_RETURN_IMMEDIATELY
flag sums up to a decimal value of 48 in the iFlag argument in ExecQuery.

This gives a semisynchronous call adding the wbemFlagForwardOnly flag
for optimization. Combining wbemFlagReturnImmediately with
wbemFlagForwardOnly results in a forward-only enumerator. A forward-only
enumerator performs much faster than the default enumerator (especially
for large datasets), because WMI doesn't maintain references to objects
in the SWbemObjectSet.

When using ExecQuery for large data sets on (remote) computers, you
really *need* this setting.

If you don't use it for large collections, you risk that the scripts
will be dog slow and in some cases grind to a halt all together.
A snail will be quick in comparison ;-)

Note that when using this setting, the Count property for the
collection returned by ExecQuery will not be available.


More here:

Improving Enumeration Performance
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/improving_enumeration_performance.asp


Platform SDK: Windows Management Instrumentation
IWbemServices::ExecQuery
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/iwbemservices_execquery.asp

Calling a Method
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/calling_a_method.asp

Making a Semisynchronous Call with VBScript
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/making_a_semisynchronous_call_with_vbscript.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top