HRESULT
GetSharedFolderState([in] LONG index,
[in] ICallback* jobDoneCallback,
[out,retval] IJob** getJob);
This function returns the state of a shared folder mounted in the virtual machine.
Dim numResults
Dim results
Dim job
Dim error
Set job = vm.GetNumSharedFolders(Nothing)
err = job.Wait(Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_COUNT), results)
If lib.ErrorIndicatesFailure(err) Then
WScript.Echo("Error: " & lib.GetErrorText(err, empty))
WScript.Quit
End If
numResults = results(0)
Dim propIds
Redim propIds(2)
' Build an array of properties to request
propIds(0) = VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_ITEM_NAME
propIds(1) = VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_HOST
propIds(2) = VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_FLAGS
For i=0 to numResults-1
Set job = vm.GetSharedFolderState(i, Nothing)
' Wait for the result, and get the result properties
err = job.Wait(propIds, results)
If lib.ErrorIndicatesFailure(err) Then
WScript.Echo("Error: " & lib.GetErrorText(err, empty))
WScript.Quit
End If
folderName = results(0) ' VIX_PROPERTY_JOB_RESULT_ITEM_NAME
folderHostPath = results(1) ' VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_HOST
folderFlags = results(2) ' VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_FLAGS
WScript.Echo(folderName & " on " & folderHostPath & " with flags: " & folderFlags)
Next