</head> <body> <h1>FileGetVersion</h1> <p>Retrieves the version of a file.</p> <pre class="Syntax"><span class="func">FileGetVersion</span>, OutputVar <span class="optional">, Filename</span></pre> <h2 id="Parameters">Parâmetros</h2> <dl> <dt>OutputVar</dt> <dd><p>The name of the variable in which to store the version number/string.</p></dd> <dt>Filename</dt> <dd><p>The name of the target file. If a full path is not specified, this function uses the search sequence specified by the system <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms684175">LoadLibrary</a> function. If omitted, the current file of the innermost enclosing <a href="LoopFile.htm">File-Loop</a> will be used instead.</p></dd> </dl> <h2 id="Error_Handling">Error Handling</h2> <p><span class="ver">[v1.1.04+]</span>: This command is able to throw an exception on failure. For more information, see <a href="Catch.htm#RuntimeErrors">Runtime Errors</a>.</p> <p><a href="../misc/ErrorLevel.htm">ErrorLevel</a> is set to 1 if there was a problem or 0 otherwise.</p> <p><a href="../Variables.htm#LastError">A_LastError</a> is set to the result of the operating system's GetLastError() function.</p> <h2 id="Remarks">Remarks</h2> <p>Most non-executable files (and even some EXEs) won't have a version, and thus <em>OutputVar</em> will be blank in these cases.</p> <h2 id="Related">Tópicos relacionados</h2> <p><a href="FileGetAttrib.htm">FileGetAttrib</a>, <a href="FileSetAttrib.htm">FileSetAttrib</a>, <a href="FileGetTime.htm">FileGetTime</a>, <a href="FileSetTime.htm">FileSetTime</a>, <a href="FileGetSize.htm">FileGetSize</a>, <a href="LoopFile.htm">File-loop</a></p> <h2 id="Examples">Exemplos</h2> <div class="ex" id="ExBasic"> <p><a class="ex_number" href="#ExBasic"></a> Retrieves the version of a file and stores it in <var>Version</var>.</p> <pre>FileGetVersion, Version, C:\My Application.exe</pre> </div> <div class="ex" id="ExBIV"> <p><a class="ex_number" href="#ExBIV"></a> Retrieves the version of the file "AutoHotkey.exe" located in AutoHotkey's installation directory and stores it in <var>Version</var>.</p> <pre>FileGetVersion, Version, %A_ProgramFiles%\AutoHotkey\AutoHotkey.exe</pre> </div> </body> </html>