Function Reference


_WinAPI_PathCommonPrefix

Compares two paths to determine if they share a common prefix

#include <WinAPIShPath.au3>
_WinAPI_PathCommonPrefix ( $sPath1, $sPath2 )

Parameters

$sPath1 The first path name.
$sPath2 The second path name.

Return Value

Returns the common prefix, @extended flag will contain the count of common prefix characters in the path.

See Also

Search PathCommonPrefix in MSDN Library.

Example

#include <WinAPIShPath.au3>

Local $sPath1 = 'C:\Documents\Test.txt'
Local $sPath2 = 'C:\Documents\Archive\Sample.txt'

ConsoleWrite('Path1 : ' & $sPath1 & @CRLF)
ConsoleWrite('Path2 : ' & $sPath2 & @CRLF)
ConsoleWrite('Prefix: ' & _WinAPI_PathCommonPrefix($sPath1, $sPath2) & @CRLF)