函数参考


_WinAPI_GetFullPathName

Retrieves the full path and file name of the specified file.

#Include <WinAPIEx.au3>
_WinAPI_GetFullPathName ( $sFile )

参数

$sFile The name of the file.

返回值

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

注意/说明

The _WinAPI_GetFullPathName() merges the name of the current drive and directory with a specified file name to
determine the full path and file name of a specified file. This function does not verify that the resulting
path and file name are valid, or that they see an existing file on the associated volume.

相关

详情参考

在MSDN中搜索


示例/演示


#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global Const $sPath1 = 'Test.txt'
Global Const $sPath2 = 'Test\Test.txt'
Global Const $sPath3 = 'C:\Test\Test.txt'

ConsoleWrite($sPath1 & ' => ' & _WinAPI_GetFullPathName($sPath1) & @CR)
ConsoleWrite($sPath2 & ' => ' & _WinAPI_GetFullPathName($sPath2) & @CR)
ConsoleWrite($sPath3 & ' => ' & _WinAPI_GetFullPathName($sPath3) & @CR)