Function Reference


_WinAPI_PathFindFileName

Searches a path for a file name

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

Parameters

$sFilePath The path to search.

Return Value

Returns the string that contains the filename.
Otherwise the original $sFilePath.

See Also

Search PathFindFileName in MSDN Library.

Example

#include <WinAPIShPath.au3>

Local $aPath[7] = ['c:\path\file', 'c:\path', 'c:\path\', 'c:\', 'c:', 'path', StringFormat('Long String %270s', '1')]

For $i = 0 To UBound($aPath) - 2
    ConsoleWrite($aPath[$i] & ' => ' & _WinAPI_PathFindFileName($aPath[$i]) & @CRLF)
Next

Local $iRet = _WinAPI_PathFindFileName($aPath[UBound($aPath) - 1])
ConsoleWrite('@error = ' & @error & ' => "' & $iRet & '"' & @CRLF)