Function Reference


_WinAPI_DefineDosDevice

Defines, redefines, or deletes MS-DOS device names

#include <WinAPIFiles.au3>
_WinAPI_DefineDosDevice ( $sDevice, $iFlags [, $sFilePath = ''] )

Parameters

$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.

Return Value

Success: True.
Failure: False, call _WinAPI_GetLastError() to get extended error information

See Also

Search DefineDosDevice in MSDN Library.

Example

#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)