Search code examples
cmdgetfileversion

Getting product version from file via cmd/bat


I have a file with Version resource that File vesrion/Product version fields are filled. I need to retrieve Product version via BAT file. Example, I have File with ProductVersion 1.0.1 in the output of bat file I wan't to have string "101" or "1.0.1"


Solution

  • How to use the Filever.exe tool to obtain specific information about a file in Windows

    From what I gather about filever's output it's always in columns and you want the fifth column (version). So a simple for should suffice:

    for /f "tokens=5 delims= " %%v in ('filever myFile.dll /b') do echo %%v