HRESULT
ListDirectoryInGuest([in] BSTR pathName,
[in] LONG options,
[in] ICallback* jobDoneCallback,
[out,retval] IJob** listJob);
This function lists a directory in the guest operating system.
Set job = vm.ListDirectoryInGuest(pathname, 0, Nothing)
err = job.WaitWithoutResults()
If lib.ErrorIndicatesFailure(err) Then
WScript.Echo("Error: " & lib.GetErrorText(err, empty))
WScript.Quit
End If
numResults = job.GetNumProperties(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_ITEM_NAME)
for i=0 to numResults-1
err = job.GetNthProperties(i, Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_ITEM_NAME), results)
If lib.ErrorIndicatesFailure(err) Then
WScript.Echo("Error: " & lib.GetErrorText(err, empty))
WScript.Quit
End If
' Print the names of files in the directory.
WScript.Echo(results(0))
Next