FileGetVersion

首页  后退  前进

FileGetVersion
down2

FileGetVersion

返回文件的版本信息.

 

FileGetVersion ( "filename" [, "stringname"] )

参数

filename

目标文件名.

stringname

[可选] 定义检索文件版本信息的字段名称:

   $FV_COMMENTS ("Comments") - 注释

   $FV_COMPANYNAME ("CompanyName") - 公司名称

   $FV_FILEDESCRIPTION ("FileDescription") - 文件说明

   $FV_FILEVERSION ("FileVersion") - 文件版本

   $FV_INTERNALNAME ("InternalName") - 内部名称

   $FV_LEGALCOPYRIGHT ("LegalCopyright") - 法律版权

   $FV_LEGALTRADEMARKS ("LegalTrademarks") - 法律商标

   $FV_ORIGINALFILENAME ("OriginalFilename") - 原始文件名

   $FV_PRODUCTNAME ("ProductName") - 产品名称

   $FV_PRODUCTVERSION ("ProductVersion") - 产品版本

   $FV_PRIVATEBUILD ("PrivateBuild") - 专用编译

   $FV_SPECIALBUILD ("SpecialBuild") - 特别编译

 

常量定义在 FileConstants.au3

返回值

成功:

返回版本号 ("#.#.#.#"格式) - 或指定字符串字段的内容

失败:

返回 "0.0.0.0" - 如果没有版本信息(或其他错误)

返回空字符串"" - 指定字符串字段没有信息 - @error 标志设置为 1

备注

另一个特殊的 "stringname" 是 "DefaultLangCodepage", 可用来检索默认的语言和代码页.

 

如果需要, 语言和代码页可用来区分 "stringname" 例如 "080904b0\Comments" (见 MSDN VerQueryValue 函数中的 StringFileInfo).

 

要得到 AutoIt 已编译脚本的版本号最好使用 @AutoItVersion 宏.

 

函数示例

#include <MsgBoxConstants.au3>
Example()
Func Example()
    ; Retrieve the file version of the AutoIt executable.
    Local $sFileVersion = FileGetVersion(@AutoItExe)
    ; Display the file version. This should be equal to @AutoItVersion.
    MsgBox($MB_SYSTEMMODAL, "", $sFileVersion)
EndFunc   ;==>Example

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

 

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

参见:

FileGetSize, FileGetTime

例子
copy

exect=$var_s=FileGetVersion(@AutoItExe,'CompiledScript')||_ViewValues('$var_s') ;; 获取使用TCIMG.exe编译的AutoIt3版本的信息

 

exect=$var_s=FileGetVersion(@ScriptName,'Version')||_ViewValues('$var_s') ;; 获取版本信息ut或你TCIMG.exe

 

exect=$var_s=FileGetVersion('%P%N')||_ViewValues('$var_s') ;;在光标下获取版本信息

up2

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