Funktionreferenz


_WinAPI_SetVolumeMountPoint


Associates a volume with a drive letter or a directory on another volume

#include <WinAPIFiles.au3>
_WinAPI_SetVolumeMountPoint ( $sFilePath, $sGUID )

Parameter

$sFilePath The user-mode path to be associated with the volume. This may be a drive letter (for example, X:\)
or a directory on another volume (for example, Y:\MountX).
$sGUID The volume GUID path for the volume. This string must be of the form "\\?\Volume{GUID}\" where
GUID is a GUID that identifies the volume. The \\?\ turns off path parsing and is ignored as part
of the path.

Rückgabewert

Success: True
Failure: False

Bemerkungen

It is an error to associate a volume with a directory that has any files or subdirectories in it. This error
occurs for system and hidden directories as well as other directories, and it occurs for system and hidden
files.

Siehe auch

Suche nach SetVolumeMountPoint in der MSDN Bibliothek.

Beispiel

#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>

Local Const $sPath = @TempDir & '\Mount\'

Local $sGUID = _WinAPI_GetVolumeNameForVolumeMountPoint(@HomeDrive & '\')

DirCreate($sPath)
_WinAPI_SetVolumeMountPoint($sPath, $sGUID)
MsgBox($MB_SYSTEMMODAL, '', 'Das Laufwerk (' & StringUpper(@HomeDrive) & ') wurde mit "' & $sPath & '" verknüpft.')
_WinAPI_DeleteVolumeMountPoint($sPath)
DirRemove($sPath)