Function Reference


Splits a path into the drive, directory, file name and file extension parts. An empty string is set if a part is missing

#include <File.au3>
_PathSplit ( $sFilePath, ByRef $sDrive, ByRef $sDir, ByRef $sFileName, ByRef $sExtension )


$sFilePath The path to be split (Can contain a UNC server or drive letter)
$sDrive String to hold the drive
$sDir String to hold the directory
$sFileName String to hold the file name
$sExtension String to hold the file extension

Return Value

Returns an array with 5 elements:
$aArray[0] = original path
$aArray[1] = drive
$aArray[2] = directory
$aArray[3] = filename
$aArray[4] = extension


This function does not take a command line string. It works on paths, not paths with arguments.


_PathFull, _PathMake


#include <Array.au3>
#include <File.au3>

Local $sDrive = "", $sDir = "", $sFileName = "", $sExtension = ""
Local $aPathSplit = _PathSplit(@ScriptFullPath, $sDrive, $sDir, $sFileName, $sExtension)
_ArrayDisplay($aPathSplit, "_PathSplit of " & @ScriptFullPath)