1.

Solve : is this bat right?

Answer»

when i open it and press "y" it says y was unexpted at this time what is wrong.

@ECHO off
set /p c=do you WANT to move on[y/n]?
if /I "%c%" "y" goto move
if /I "%c%" "n" exit
:move
set /p c=do you REALLY want to continue[y/n]?
if /I "%c%" "y" goto bob
if /i "%c%" "n" exit
:bob
set /p c=are you positive[y/n]?
if /I "%c%" "y" goto positive
if /I "%c%" "n" goto END
:positive
call bob.bat
cls
Missing either == or equ between strings in the If command lines. Enter IF/? at the command PROMPT to study the command.

Batch label END not defined. Command goto end fails. Enter GOTO/? at the command prompt to study the command.This should work:

Code: [Select]@echo off
set /p c=do you want to move on[y/n]?
if /I %c%==y goto move
if /I %c%==n exit
:move
set /p c=do you really want to continue[y/n]?
if /I %c%==y goto bob
if /i %c%==n exit
:bob
set /p c=are you positive[y/n]?
if /I %c%==y goto positive
if /I %c%==n goto end
:positive
cls
call bob.bat
:end
::(Your code for this part goes here)



Discussion

No Comment Found