Name

ListProcessesInGuest

Description

HRESULT
ListProcessesInGuest([in] LONG options,
                     [in] ICallback* jobDoneCallback,
                     [out,retval] IJob** listJob);

This function lists the running processes in the guest operating system.

Parameters

options
Must be 0.
jobDoneCallback
A callback function that will be invoked when the operation is complete.
listJob
Returns an IJob object that describes the state of this asynchronous operation.

Return Value

HRESULT

Remarks

on the returned job handle:

Side Effects

None.

Requirements

VixCOM.h, since VMware Workstation 6.0

Example

Set job = vm.ListProcessesInGuest(0, Nothing)
err = job.WaitWithoutResults()
QuitIfError(err) 

numResults = job.GetNumProperties(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_ITEM_NAME)

Dim prop
ReDim prop(3)
' Populate the array of properties to request.
prop(0) = VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_ITEM_NAME
prop(1) = VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_PROCESS_ID
prop(2) = VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_PROCESS_OWNER
prop(3) = VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_PROCESS_COMMAND
for i=0 to numResults-1
   err = job.GetNthProperties(i, prop, results)
   QuitIfError(err)
   ' Unpack the results.
   name = results(0)
   pid = CStr(results(1))
   ownder = results(2)
   cmd = results(3)
   WScript.Echo(name & " (" & pid & "): " & owner & ", " & cmd)
Next

Copyright (C) 2007 VMware, Inc. All rights reserved.