I'm trying to write a script that prompts the user for a drive letter and then validate the entry insofar that it is a single character and falls within a valid range: D-Z
This is what I have so far:
setlocal enableextensions enabledelayedexpansion
set MIN_DRIVE_LOWER=d
set MAX_DRIVE_LOWER=z
set /P RELEASE_DRIVE="What is the assigned network drive letter on this workstation? "
echo Release drive is %RELEASE_DRIVE%
if /I !RELEASE_DRIVE! GEQ %MIN_DRIVE_LOWER% (
if /I !RELEASE_DRIVE! LEQ %MAX_DRIVE_LOWER% (
echo Release drive is lower-case.
)
)
No matter what I enter at the prompt my script reaches the "echo Release drive is lower-case." Any thoughts or suggestions would be much appreciated.
/I?/itellsifto ignore capitalization.