Removes the trailing file name and backslash from a path, if they are present
#include <WinAPIShPath.au3>
_WinAPI_PathRemoveFileSpec ( $sFilePath )
$sFilePath | The path from which to remove the file name. |
Search PathRemoveFileSpec in MSDN Library.
#include <WinAPIShPath.au3>
Local $sPath = 'C:\Documents\Test.txt'
ConsoleWrite('Before: ' & $sPath & @CRLF)
ConsoleWrite('After : ' & _WinAPI_PathRemoveFileSpec($sPath) & @CRLF)