Name
EnableSharedFolders
Description
HRESULT
EnableSharedFolders([in] VARIANT_BOOL enabled,
[in] LONG options,
[in] ICallback* jobDoneCallback,
[out,retval] IJob** enableJob);
This function enables or disables all shared folders as a feature for a virtual
machine.
Parameters
- enabled
-
Pass true if enabling shared folders is desired. Pass false otherwise.
- options
-
Must be 0.
- jobDoneCallback
-
An ICallback instance that will be called when the
operation is complete.
- directoryJob
-
Returns an IJob object that describes the state of this asynchronous operation.
Return Value
HRESULT
Remarks
- This function enables/disables all shared folders as a feature on a virtual
machine. In order to access shared folders on a guest, the feature has to be
enabled, and in addition, the individual shared folder has to be enabled.
- It is not necessary to call VM::LoginInGuest() before calling this function.
- In this release, this function requires the virtual machine to be powered on
with VMware Tools installed.
- In this release, the shared folder setting from this function is not preserved
after the virtual machine is powered off. When a virtual machine is powered
back on, the default setting is "disabled".
- Shared folders are not supported for the following guest operating systems:
Windows ME, Windows 98, Windows 95, Windows 3.x, and DOS.
Side Effects
- On Linux virtual machines, calling this function will automatically mount
shared folder(s) in the guest.
Requirements
VixCOM.h, since VMware Workstation 6.0
Example
Dim job
Dim err
' Turn shared folders on.
Set job = vm.EnableSharedFolders(true, 0, Nothing)
err = job.WaitWithoutResults()
If lib.ErrorIndicatesFailure(err) Then
WScript.Echo("Error: " & lib.GetErrorText(err, empty))
WScript.Quit
End If