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 |
This function does not take a command line string. It works on paths, not paths with arguments.
| $PATH_ORIGINAL | 0 |
|---|---|
| $PATH_DRIVE | 1 |
| $PATH_DIRECTORY | 2 |
| $PATH_FILENAME | 3 |
| $PATH_EXTENSION | 4 |
#include <Array.au3>
#include <File.au3>
Local $sDrive = "", $sDir = "", $sFileName = "", $sExtension = ""
Local $aPathSplit = _PathSplit(@ScriptFullPath, $sDrive, $sDir, $sFileName, $sExtension)
_ArrayDisplay($aPathSplit, "_PathSplit of " & @ScriptFullPath)