函数参考


_WinAPI_PathAppend

Appends one path to the end of another.

#Include <WinAPIEx.au3>
_WinAPI_PathAppend ( $sPath, $sMore )

参数

$sPath The string to which the path is appended.
$sMore The path to be appended.

返回值

Success The resulting path string.
Failure Empty string and sets the @error flag to non-zero.

注意/说明

This function automatically inserts a backslash between the two strings, if one is not already present.

The first path cannot begin with "..\\" or ".\\" to produce a relative path string. If present, those periods are
stripped from the output string. For example, appending "path3" to "..\\path1\\path2" results in an output
of "\path1\path2\path3" rather than "..\path1\path2\path3".

相关

详情参考

在MSDN中搜索


示例/演示


#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global $Path1 = 'C:\Documents\Text'
Global $Path2 = '..\Test.txt'

ConsoleWrite('Path1 : ' & $Path1 & @CR)
ConsoleWrite('Path2 : ' & $Path2 & @CR)
ConsoleWrite('Result: ' & _WinAPI_PathAppend($Path1, $Path2) & @CR)