Name

AddSharedFolder

Description

HRESULT
AddSharedFolder([in] BSTR shareName,
                [in] BSTR hostPathName,
                [in] LONG flags,
                [in] ICallback* jobDoneCallback,
                [out,retval] IJob** addJob);

This function mounts a new shared folder in the virtual machine.

Parameters

shareName
Specifies the guest path name of the new shared folder.
hostPathName
Specifies the host path of the shared folder.
flags
The folder options.
jobDoneCallback
An ICallback instance that will be called when the operation is complete.
addJob
Returns an IJob object that describes the state of this asynchronous operation.

Return Value

HRESULT

Remarks

Side Effects

None.

Requirements

VixCOM.h, since VMware Workstation 6.0

Example

VBScript:
Dim job
Dim err

Set job = vm.AddSharedFolder("WorkDir", "/work", VixCOM.Constants.VIX_SHAREDFOLDER_WRITE_ACCESS, Nothing)
err = job.WaitWithoutResults()
If lib.ErrorIndicatesFailure(err) Then
   ' Handle the error...
End If

Set job = Nothing

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