Ask User for Input (String) ?? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Ask User for Input (String) ??

bholeudaybholeuday Posts: 3Member

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

[color=Red][size=2]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[/size][/color]

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

Thanks & regards

Uday Bhole
Sign In or Register to comment.