doesn't this do what you want??

$state=WMIQuery('state','Win32_Service',@wksta,'Name','WinVNC')[0]
? $state

or

for each $service in WMIQuery('name','Win32_Service',@wksta,'state','running')
? $service
next
_________________________
How to ask questions the smart way <-----------> Before you ask