格式化路径为完整有效的路径.
#Include <WinAPIEx.au3>
_WinAPI_PathSearchAndQualify ( $sPath [, $fExists] )
$sPath | The path to be formated. |
$fExists | [可选参数] 指定路径是否存在,有效的值: 1 - 路径必须存在,否则,函数将失败. 0 - 路径可以不存在. (默认) |
成功: | 返回格式化路径. |
失败: | 返回空字符串,设置 @error 标志为非 0 值. |
在MSDN中搜索
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global Const $sPath1 = 'C:\\Test\\'
Global Const $sPath2 = 'C:/Test/Test.txt'
Global Const $sPath3 = 'Notepad.exe'
ConsoleWrite($sPath1 & ' => ' & _WinAPI_PathSearchAndQualify($sPath1) & @CR)
ConsoleWrite($sPath2 & ' => ' & _WinAPI_PathSearchAndQualify($sPath2) & @CR)
ConsoleWrite($sPath3 & ' => ' & _WinAPI_PathSearchAndQualify($sPath3) & @CR)