Name
VMRemoveSharedFolder
Description
$err = VMRemoveSharedFolder($vmHandle,
$shareName,
$flags);
This function removes a shared folder in the virtual machine.
Parameters
- vmHandle
-
Identifies a virtual machine. Call VMOpen() to create a virtual machine handle.
- shareName
-
Specifies the guest pathname of the shared folder to delete.
- flags
-
Must be 0.
Return Value
$err. The error code returned by the operation. For returned values, see Topics > Error Codes.
Remarks
- This function removes a shared folder in the virtual machine
referenced by vmHandle.
- It is not necessary to call
VMLoginInGuest()
before calling this function.
- Shared folders are not supported for the following guest operating systems:
Windows ME, Windows 98, Windows 95, Windows 3.x, and DOS.
- In this release, this function requires the virtual machine to be powered on
with VMware Tools installed.
- Depending on the behavior of the guest operating system, when removing
shared folders, there might be a delay before the shared
folder is no longer visible to programs running within the guest operating
system and to functions such as VixVM_FileExistsInGuest.
Requirements
use VMware::Vix::Simple;
use VMware::Vix::API::Constants;
since VMware Workstation 6.0
Example
my $err;
$err = VMRemoveSharedFolder($vmHandle,
"/work",
0);
die "VMRemoveSharedFolder() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;