FileGetShortName

首页  后退  前进

FileGetShortName
down2

FileGetShortName

返回 8.3 格式短路径名称.

 

FileGetShortName ( "filename" [, flag = 0] )

参数

filename

目标文件完整路径

flag

[可选]

   $FN_FULLPATH (0) - 默认

   $FN_RELATIVEPATH (1) - 文件可以是相对路径如 "..\file.txt"

 

常量定义在 FileConstants.au3

返回值

成功:

返回 8.3 格式短路径和文件名称.

失败:

返回参数值, 设置 @error 为 1.

备注

文件必须存在, 如果有几个文件的前 8 个字符相同, 目前没有办法知道 ~i 到底是哪个文件.

 

函数示例

#include <MsgBoxConstants.au3>
Example()
Func Example()
    ; Create a constant variable in Local scope of the filepath to retrieve the shortname of.
    Local Const $sFilePath = @ProgramFilesDir
    ; Display the short path+name of the program files directory.
    MsgBox($MB_SYSTEMMODAL, "", FileGetShortName($sFilePath))
EndFunc   ;==>Example

----------------------------------------

 

该函数可以通过命令 exect 调用

参见:

FileGetLongName

例子
copy

exect=$var_spath=FileGetShortName('D:\TC~~IMAGE\')||_ViewValues('$var_spath') ;; 返回短路径"D:\TCIMAG〜1"

up2

tcimage © Аверин Андрей для Total Commander Image Averin-And@yandex.ru