{"id":98855,"date":"2018-05-29T07:00:00","date_gmt":"2018-05-29T21:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=98855"},"modified":"2019-03-13T00:44:31","modified_gmt":"2019-03-13T07:44:31","slug":"20180529-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20180529-00\/?p=98855","title":{"rendered":"How do I get file version information from the command line?"},"content":{"rendered":"<p>The great thing about Windows file versions is that there are so many to choose from! <\/p>\n<p>For each file, you have <\/p>\n<ul>\n<li>Numeric product version<\/li>\n<li>Numeric file version<\/li>\n<li>String product version<\/li>\n<li>String file version<\/li>\n<\/ul>\n<p>The numeric and string versions generally match, but there is no enforcement. Often the string version incorporates the numeric version but adds some additional information, like <tt>3.1.0.2 (alpha)<\/tt>. Sometimes the string version disagrees with the numeric version. This can happen when MUI satellite DLLs enter the picture. <\/p>\n<p>You can use PowerShell to obtain the version information for a file. <\/p>\n<pre>\nPS&gt; (Get-Command C:\\Path\\To\\Thing.dll).FileVersionInfo.FileVersion\n3.1.0.2\n<\/pre>\n<p>The version number parts of the <code>File&shy;Version&shy;Info<\/code> are <\/p>\n<table CLASS=\"cp3\" BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\" STYLE=\"border-collapse: collapse\">\n<tr>\n<th>Product Field<\/th>\n<th>File Field<\/th>\n<th>Meaning<\/th>\n<th>Example<\/th>\n<\/tr>\n<tr>\n<td>ProductVersion<\/td>\n<td>FileVersion<\/td>\n<td>String version<\/td>\n<td>3.1.0.2 (alpha)<\/td>\n<\/tr>\n<tr>\n<td>ProductMajorPart<\/td>\n<td>FileMajorPart<\/td>\n<td>First number<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>ProductMinorPart<\/td>\n<td>FileMinorPart<\/td>\n<td>Second number<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>ProductBuildPart<\/td>\n<td>FileBuildPart<\/td>\n<td>Third number<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>ProductPrivatePart<\/td>\n<td>FilePrivatePart<\/td>\n<td>Fourth number<\/td>\n<td>2<\/td>\n<\/tr>\n<\/table>\n<p>Further reading: <a HREF=\"https:\/\/blogs.technet.microsoft.com\/askpfeplat\/2014\/12\/07\/how-to-correctly-check-file-versions-with-powershell\/\">How to (correctly) check file versions with PowerShell<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell does for you.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[104],"class_list":["post-98855","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>PowerShell does for you.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/98855","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=98855"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/98855\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=98855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=98855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=98855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}