Function Reference


_PathSplit

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 )

Parameters

$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

Remarks

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

Related

_PathFull, _PathMake

Example

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

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