Function Reference


_WinAPI_PathRemoveFileSpec

Removes the trailing file name and backslash from a path, if they are present

#include <WinAPIShPath.au3>
_WinAPI_PathRemoveFileSpec ( $sFilePath )

Parameters

$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.

Example

#include <WinAPIShPath.au3>

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

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