Function Reference


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.

Return Value

Returns the path without file name, @extended non zero if something have been removed.

See Also

Search PathRemoveFileSpec in MSDN Library.


#include <WinAPIShPath.au3>

Local $sPath = 'C:\Documents\Test.txt'

ConsoleWrite('Before: ' & $sPath & @CRLF)
ConsoleWrite('After : ' & _WinAPI_PathRemoveFileSpec($sPath) & @CRLF)