Removes the decoration from a path string.
#Include <WinAPIEx.au3>
_WinAPI_PathUndecorate ( $sPath )
$sPath | The path. |
Success | The undecorated string. |
Failure | Empty string and sets the @error flag to non-zero. |
在MSDN中搜索
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $Path[4] = ['C:\Path\File[5].txt', 'C:\Path\File[12]', 'C:\Path\File.txt', 'C:\Path\[3].txt']
For $i = 0 To 3
ConsoleWrite(StringFormat('%-22s' & _WinAPI_PathUndecorate($Path[$i]), $Path[$i]) & @CR)
Next