1.

Solve : is this bat file right. cause it will not work.?

Answer»

@echo off
echo 1 -stars
echo 2 -dollar signs
echo 3 - crosses


choice /C:123

if errorlevel 3 GOTO crs
if errorlevel 2 goto dlr
if errorlevel 1 goto str

:str
echo ****************************************
echo.
pause
goto :question

:dlr
echo $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
echo.
pause
goto :question

:crs
echo ++++++++++++++++++++++++++++++++++++++++++
echo.
pause
goto :question

:question
:choice
set /p c=did you like it[y/n]?
if /I "%c%" equ "y" goto :yes
if /I "%c%" equ "n" goto :no

goto :choice

:yes
echo great i am GLAD you LIKED it!!!!!!
pause
exit

:no echo you didn't well to bad
pause
exit

Quote from: computerperson#1 on May 20, 2009, 03:37:01 PM

@echo off
echo 1 -stars
echo 2 -dollar signs
echo 3 - crosses


choice /C:123

if errorlevel 3 goto crs
if errorlevel 2 goto dlr
if errorlevel 1 goto str

:str
echo ****************************************
echo.
pause
goto :question

:dlr
echo $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
echo.
pause
goto :question

:crs
echo ++++++++++++++++++++++++++++++++++++++++++
echo.
pause
goto :question

:question
:choice
set /p c=did you like it[y/n]?
if /I "%c%" equ "y" goto :yes
if /I "%c%" equ "n" goto :no

goto :choice

:yes
echo great i am glad you liked it!!!!!!
pause
exit

:no echo you didn't well to bad
pause
exit


First off, you need to add ^ before each $ (and possible the * and +). Also, ":no" and "echo you didn't well to bad" need to be on different lines.thanks but when i open it , it says choice is not a recognized internal or EXTERNAL command operable program or batch file.Quote from: computerperson#1 on May 20, 2009, 04:13:18 PM
thanks but when i open it , it says choice is not a recognized internal or external command operable program or batch file.
Because you don't have it on your computer...that's why. Use set /p variablename= instead.Code: [Select]@ECHO OFF
:Begin
ECHO 1 - Stars
ECHO 2 - Dollar Signs
ECHO 3 - Crosses
ECHO 4 - Stop
echo Enter Choice

SET /P choice=

IF %choice% EQU 4 goto end

IF %choice% EQU 3 goto CRS

IF %choice% EQU 2 goto DLR

IF %choice% EQU 1 goto STR
goto begin


:STR
ECHO *******************
ECHO.
PAUSE
CLS
Goto Begin


:DLR
ECHO $$$$$$$$$$$$$$$$$$$$
ECHO.
PAUSE
CLS
goto Begin

:CRS
ECHO +++++++++++++++++++++
ECHO.
PAUSE
CLS
goto Begin
:end
Output:
1 - Stars
2 - Dollar Signs
3 - Crosses
4 - Stop
Enter Choice
2
$$$$$$$$$$$$$$$$$$$$

Press any key to continue . . .Quote from: billrich on May 20, 2009, 04:56:49 PM
Code: [Select]@ECHO OFF
:Begin
ECHO 1 - Stars
ECHO 2 - Dollar Signs
ECHO 3 - Crosses
ECHO 4 - Stop
echo Enter Choice

SET /P choice=

IF %choice% EQU 4 goto end

IF %choice% EQU 3 goto CRS

IF %choice% EQU 2 goto DLR

IF %choice% EQU 1 goto STR
goto begin


:STR
ECHO *******************
ECHO.
PAUSE
CLS
Goto Begin


:DLR
ECHO $$$$$$$$$$$$$$$$$$$$
ECHO.
PAUSE
CLS
goto Begin

:CRS
ECHO +++++++++++++++++++++
ECHO.
PAUSE
CLS
goto Begin
:end
Output:
1 - Stars
2 - Dollar Signs
3 - Crosses
4 - Stop
Enter Choice
2
$$$$$$$$$$$$$$$$$$$$

Press any key to continue . . .
Try putting a CLS right after :begin ...thanks it works Quote from: computerperson#1 on May 21, 2009, 05:47:41 AM
thanks it works
You're welcome! You can stay as LONG as you want, either getting help or giving it!


Discussion

No Comment Found