title: Why does the command GOTO atack1 not result in executing the code below line :attack1 on batch file execution?
body: <p>I've started to learn batch/shell a while ago. and I started to make a text based rpg called bpg. anyways, I poured a day into making the basic structure of it and then I found out the cmd closes when I use the attack trigger. I ran over it a million times, but can't find anything wrong with it. Please help.</p>
  
  <p>The batch file can be downloaded from <a href="https://www.dropbox.com/s/f8r7cs0tvo8qhs8/bpg.bat?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/f8r7cs0tvo8qhs8/bpg.bat?dl=0</a></p>
  
  <p>Here is the code:</p>
  
  <pre><code>@echo off
  if not "%1" == "max" start /MAX cmd /c %0 max &amp; exit/b
  title BPG 1 A batch of monsters
  setlocal enabledelayedexpansion
  color 2
  
  :menu
  cls
  echo  ______   _______   _______
  echo I  ___ \ I  ____ I I ____  \
  echo I I   I II I    II I I    \/
  echo I  __ I  I  _____I I I ____
  echo I I  \ \ I I       I I \_  I
  echo I I___I II I       I I___I I
  echo I______/ I_/       I_______I A BATCH OF MONSTERS
  echo.
  echo.
  echo 1) begin
  echo.
  echo 2) exit
  echo.
  set /p c=bpg:
  
  if "%c%" == "1" goto new
  if "%c%" == "2" exit
  goto menu
  
  :new
  set health=100
  set enemyhealth=30
  set playerdmg=10
  set monsterdmg=10
  goto home
  
  :home
  cls
  echo --------------------
  echo   Welcome to BPG
  echo --------------------
  echo (noobs can f off)
  echo.
  echo 1) Battle
  echo 2) Menu
  echo.
  
  set /p c=bpg
  
  if "!c!" == "1" goto encounter1
  if "!c!" == "2" goto menu
  goto home
  
  :encounter1
  cls
  echo --------------------
  echo You: %health%
  echo Enemy: %enemyhealth%
  echo --------------------
  echo.
  echo 1) attack
  echo.
  echo 2) flee
  echo.
  set /p c=bpg
  if "!c!" == "1" goto atack1
  if "!c!" == "2" goto home
  goto encounter1
  
  :attack1
  set /a !health!-=!monsterdmg!
  set /a !monsterhealth!-=!playerdmg!
  if !monsterhealth! lss 0 goto win
  goto encounter
  
  :win
  cls
  echo.
  echo --------------------
  echo You Win!
  echo --------------------
  echo              _.oood"""""""booo._
  echo          _.o""      _____    . ""o._
  echo        oP"  _.ooo""""   """"oIo._. "Yo
  echo      o8   oP  _.-":          I I"._. .8o
  echo     d'  o8',-"    :          I I/  ,\. .b
  echo    d'  d.-"      :           I I: (( .\
  echo   8'  d' """"":  :           I I  II\_/. .8
  echo  8   8'      :  :       I)   _ I  II I.I   8
  echo ,8  8        :  :     /)I \ II I\_II I I8  8.
  echo 8' ,8       :  :      " /_) I.:' I I I I8. .8
  echo 8  8'       :  :        _ _-'  \ ' __   __  8
  echo 8  8       :  :         \I__ I  I I  I I 8I 8
  echo 8  8.      :  :         II   I  I I-:' I 8I 8
  echo 8. .8     /   I      __/ I__ I__I I  \ I__I,8
  echo 8  8   .'    \     /     __ . . . . . .8LL8'
  echo  8   8.'       -. (    ,'  .. I I ,-I8  8
  echo   8.(__________dd_) \__/ '  0I...: I: (8 ,8
  echo    Y.  Y.                    I :/I I,\I. .P
  echo     Y.  "8.          .,o     I I I,I".  ,P
  echo      "8.  "Yo_               I IpI". ,8"
  echo        "Y_   "ooo.__   __.ooI". . _P"
  echo          '"oo_     """""    . _oo""'
  echo               ."""boooooood"""'.
  echo.
  echo.
  pause
  </code></pre>