title: Batch file:- Detect windows version and run exe file
body: <p>I want to detect windows version from batch and as per result start exe file </p>
  
  <p>Sample code not working</p>
  
  <pre><code>@echo off
  setlocal
  for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
  if "%version%" geq "6.2" goto netfx_4
  if "%version%" == "6.1" goto netfx_35
  if "%version%" == "6.0" goto netfx_35
  
  :netfx_35
   start "C:\Users\Ankur\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Notepad.lnk"
  exit 1
  goto :EOF
  
  :netfx_4
  start "C:\Users\Ankur\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Notepad.lnk"
  exit 1
  goto :EOF
  
  endlocal
  </code></pre>
  
  <blockquote>
    <p>for testing on place of exe i start notepad file</p>
  </blockquote>
  
  <p>but this code is not working.</p>