MS-DOS

Moderators: blip
Number of threads: 362
Number of posts: 872

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Ask User for Input (String) ?? Posted by bholeuday on 14 Apr 2009 at 6:43 AM
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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.