I thnink I've found the problem. Run this script and wonder
code:
$oSvc = GetObject("winmgmts:root\cimv2")
$oInstSet = $oSvc.ExecQuery("SELECT Name FROM Win32_Process",,48)
? 'Running it for the first time'
For Each $oInst in $oInstSet
? "Process 1: " + $oInst.name
Next
? 'Running it for the second time'
For Each $oInst in $oInstSet
? "Process 2: " + $oInst.name
Next
It looks to me as if there's soem kind of recordset pointer involved which doesn't get set back, thus if you run it a second time it's at the end of the recordset.
Now I just have to find a way to set it back to the start without creating a copy of the object.
_________________________
There are two types of vessels, submarines and targets.