Take the 2-minute tour ×

I want to retrive the product version number of an exe. If possible I need some thing which can work from the command line.

Also is there an utility for unix as well? I need this on both mac and pc.

Thanks in advance.


share|improve this question

1 Answer 1



using System.Diagnostics;

public void GetFileVersion()
// Get the file version for the notepad.
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(@"C:\A.exe");

// Print the file name and version number.
String text = "File: " + myFileVersionInfo.FileDescription + '\n' +
"Version number: " + myFileVersionInfo.FileVersion;

or via reading the PE header of the EXE is probably the best bet:


share|improve this answer

Your Answer


