title: How to get major, minor, etc. version number of a program in batch file?
body: <p>A program returns a version string of this regex type <code>[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}</code> on the command line. Therefore the output looks like this:</p>
  
  <pre><code>C:\users\user\desktop&gt;a.exe --version
  Version: 1.22.53.4134
  </code></pre>
  
  <p>I save the output to a variable <code>Version</code> by this <strong>get-version-info.bat</strong></p>
  
  <pre><code>for /f "usebackq tokens=1* delims=: " %%i in (`a.exe --version`) do (
      if /i "%%i"=="Version" set "Version=%%j"
  )
  </code></pre>
  
  <p>To solve my exact problem I only need the <strong>major</strong> and <strong>minor</strong> release number(s), but a general, adaptable solution would be also good of course.</p>
  
  <p>How to get major and minor version number of the program in batch file?</p>