|
This is expected behaviour, as per the documentation of the 'wbemFlagForwardOnly' flag (value 32):
Causes a forward-only enumerator to be returned. Use this flag in combination with wbemFlagReturnImmediately to request semisynchronous access.
You can only iterate (as in a For Each statement) through a forward-only enumerator one time. The memory containing the instances is released by WMI so that the enumerator cannot be rewound. Therefore, the Count method cannot be used since it requires rewinding the enumerator.
Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to Clone or Reset.
--Ruud
|