[AccessD] OT:Batch File Syntax

Arthur Fuller fuller.artful at gmail.com
Wed Mar 19 06:59:36 CDT 2008


Here's another in the ongoing batch-command tutorial. Save this as
demochoice.cmd and then run it:

@ECHO off
cls
:start
ECHO.
ECHO 1. Print Hello
ECHO 2. Print Bye
ECHO 3. Print Test
set choice=
set /p choice=Type the number to print text.
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto hello
if '%choice%'=='2' goto bye
if '%choice%'=='3' goto test
ECHO "%choice%" is not valid please try again
ECHO.
goto start
:hello
ECHO HELLO
goto end
:bye
ECHO BYE
goto end
:test
ECHO TEST
goto end
:end

Arthur



More information about the AccessD mailing list