title: Create a database within a bat file
body: <p>I am trying to create a bat file that is in essence a database. I want to be able to enter information that is tied to a single record. When I enter a record, I want to be able to look up the record by the card number assigned to it. The code I have now doesn't really work due to the fact that the variables are not being stored properly. </p>
  
  <p>This is my code:</p>
  
  <pre><code>Color 5F
  @echo off
  :start
  cls
  echo ==========================================
  echo           Gift Card
  echo ==========================================
  echo.
  echo What would you like to do?
  echo.
  echo    1 Add Card
  echo    2 Check Information
  echo    3 Edit Card Balance
  echo    4 Delete Card
  echo.
  set /p choice=Please enter choice: 
  if /I %choice%==1 goto 1
  if /I %choice%==2 goto 2
  
  :1
  echo.
  set /p var=Enter Card Number: 
  set /p val=Enter Amount: 
  set /p fname=Enter First Name: 
  set /p lname=Enter Last Name: 
  set /p cbal=Enter Current Balance: 
  set /p diss=Enter Date issued: 
  @echo set %var%=%val%=%fname%=%lname%=%cbal%=%diss% &gt; %var%.bat
  echo.
  echo The data has been stored!
  pause
  goto start
  
  :2
  echo.
  set /p var=Please enter card number: 
  setlocal enabledelayedexpansion
  call %var%.bat
  echo !%fname%! !%lname%!'s !%var%! card has $!%cbal%! on it as of !%diss%!!
  pause &gt; nul
  goto start
  </code></pre>
  
  <p>I have tried to send the variables separately and altogether and none have worked. I am thinking it is because I do not have the delayed expansion sytax correct. </p>
  
  <p>Any help is very appreciated!</p>