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

Side Effects

Requirements

VixCOM.h, since VMware Workstation 6.0
Minimum Supported Guest OS: Microsoft Windows NT Series, Linux

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

Set job = Nothing

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