http://www.todayandtomorrow.net/2009/12/02/arcade-expressionism/



http://www.itistheworldthatmadeyousmall.com
Jay is a game developer.
Imagine you’re on the first slide of your powerpoint presentation and want to move to the next slide. Your remote control has two buttons. They are unmarked, but one button points up and one button points down.The result is half and half.
Which button do you press?
CHOICE /M "Do you agree?"This will print out a message "Do you agree? [Y,N]" and you can type in "y" key or "n" key to answer. Other keys are ignored and enter key after "y/n" is not needed.
CHOICE /C XPD /M "Do you like [X]box360 games or [P]layStation3 games? ([D]on't care)"Now you will have "X", "P", and "D" choices instead of simply "Y/N".
CHOICE /C XPD /M "Do you like [X]box360 games or [P]layStation3 games? ([D]on't care)"There is one more thing to note.
IF ERRORLEVEL 3 GOTO :DONT_CARE
IF ERRORLEVEL 2 GOTO :LIKE_PS3
IF ERRORLEVEL 1 GOTO :LIKE_XBOX
vote.bat ps3Then in the batch file, the argument is parsed in this way:
@ECHO OFFNow, we need to remember that the batch file takes either "xbox" or "ps3". It shouldn't be "xbox360" or "pS3". So we now need to add HELP message like this:
IF "%1" == "ps3" GOTO :VOTE_FOR_PS3
IF "%1" == "xbox" GOTO :VOTE_FOR_XBOX
@ECHO OFFWith "CHOICE" command, we can make this batch file much simple:
IF "%1" == "ps3" GOTO :VOTE_FOR_PS3
IF "%1" == "xbox" GOTO :VOTE_FOR_XBOX
GOTO :HELP
:HELP
ECHO USAGE: vote.bat [xbox|ps3]
@ECHO OFFThere is no need to have dedicated Help sub-routine. And don't need to bother with Case-sensitiveness.
CHOICE /C XP /M "Vote for [X]box or [P]s3?"
ECHO x | vote.batThis will have a same effect to a command, "vote.bat xbox", without any interactive pause.