I need to convert user input from cmd into lowercase before my script can use it , so i can use it in a If statement but i don't know exactly how , i tryed to just compare the input with the most common inputs that the user may write but i want to cover all the posibilities.
here is the code i wrote so far :
set colour=Default
echo Please choose one of the supported colours for the name(Red,Blue or
Green)
:WrongColour
set /p colour=
if %colour%== Red (
goto :SuportedColour
) else if %colour%== red (
goto :SuportedColour
) else if %colour%== RED (
goto :SuportedColour
) else if %colour%== Blue (
goto :SuportedColour
) else if %colour%== blue (
goto :SuportedColour
) else if %colour%== BLUE (
goto :SuportedColour
) else if %colour%== Green (
goto :SuportedColour
) else if %colour%== green (
goto :SuportedColour
) else if %colour%== GREEN (
goto :SuportedColour
)
Is there a much easier way to just convert everything into lowercase so then i can compare to it and proceed to the next stage in my script if yes?