I am creating a batch script where I have to compare versions and then proceed with the installation. I am getting error @ when I use or
(||
) in if
. How do I compare two conditions in one if
? I tried using a for loop by creating a list of values and then comparing. This is also giving me an error.
@echo off
set "python_ver=Python 3.7"
set "python_major=(not found)"
set "python_minor=(not found)"
FOR /f "tokens=1,2 delims=." %%a IN ("%python_ver%") do set
python_major=%%a & set python_minor=%%b
FOR /f "tokens=1,2 delims= " %%a IN ("%python_major%") do set
python_major=%%b
if %python_major%==3 (
if %python_minor% LSS 5 or if %python_minor% GTR 6 (
echo version not supported. should be 3.5 or 3.6
) else (
echo go to install
)
) else (
echo Please update your python
)