1.

Solve : Ask User for Input String and then play with IF clause?

Answer»

Hi,

I have BATCH file and i want it to ask for the User input (String) like below thing, i know how to do it for a NUMBER input but do not know how to do it with String input.
Logic should be like these

REM Please Enter Environment Details Options are
REM ricdb
REM cfgcent
REM cmd
REM wld

SET CHOICE
set /p choice=Type the Environment to deploy
if not '%choice%'=='' set choice=%choice:~0,1%

IF '%choice%'=='wld' GOTO WLD
IF '%choice%'=='cmd' GOTO CMD
IF '%choice%'=='cfgcent' GOTO CFGCENT
IF '%choice%'=='ricdb' GOTO RICDB
ECHO "%choice%" is not valid please try again


Choice does not work in these case.
Please HELP regarding the same.

Thanks & regards

Uday Bhole

double post see other thread



Discussion

No Comment Found