 <p>This should work:</p> <pre><code>@ECHO OFF FOR /F "tokens=*" %%a IN ('ver') DO ( SET ver=%%a ) SET v1=%ver:~27,1% SET v2=%ver:~29,1% IF %v1% LSS 6 GOTO JUMPTO IF %v2% LSS 2 GOTO JUMPTO ECHO doing something PAUSE GOTO:EOF :JUMPTO ECHO Windows version too old! PAUSE </code></pre>