Defines, redefines, or deletes MS-DOS device names
#include <WinAPIFiles.au3>
_WinAPI_DefineDosDevice ( $sDevice, $iFlags [, $sFilePath = ''] )
$sDevice | The name of the MS-DOS device. |
$iFlags | This parameter can be one or more of the following values. $DDD_EXACT_MATCH_ON_REMOVE $DDD_NO_BROADCAST_SYSTEM $DDD_RAW_TARGET_PATH $DDD_REMOVE_DEFINITION |
$sFilePath | [optional] The path that will implement device. |
Success: | True. |
Failure: | False, call _WinAPI_GetLastError() to get extended error information |
Search DefineDosDevice in MSDN Library.
#include <APIFilesConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
Local $sDevice = 'Z:'
Local Const $sPath = @ScriptDir
If _WinAPI_DefineDosDevice($sDevice, $DDD_RAW_TARGET_PATH, '\DosDevices\' & $sPath) Then
MsgBox(($MB_ICONINFORMATION + $MB_SYSTEMMODAL), '', 'The drive "' & $sDevice & '" has been created.' & @CRLF & @CRLF & 'Press OK to release drive.')
EndIf
_WinAPI_DefineDosDevice($sDevice, BitOR($DDD_EXACT_MATCH_ON_REMOVE, $DDD_RAW_TARGET_PATH, $DDD_REMOVE_DEFINITION), '\DosDevices\' & $sPath)