Retrieves the version of a file.

Version := FileGetVersion(Filename)



Type: String

The name of the target file. If a full path is not specified, this function uses the search sequence specified by the system LoadLibrary function. If omitted, the current file of the innermost enclosing File-Loop will be used instead.

Return Value

Type: String

This function returns the version number of the specified file.

Error Handling

An exception is thrown on failure.

A_LastError is set to the result of the operating system's GetLastError() function.


Most non-executable files (and even some EXEs) won't have a version, and thus the return value will be blank in these cases.


FileGetAttrib, FileSetAttrib, FileGetTime, FileSetTime, FileGetSize, File-loop



version := FileGetVersion("C:\My Application.exe")
version := FileGetVersion(A_ProgramFiles "\AutoHotkey\AutoHotkey.exe")