title: In batch, how would i go about undoing something?
body: <p>Im playing around with batch, and im trying to make a little fun thingy. i have a couple problems:</p>
  
  <p>when in either :backcol or :textcol when i change the color of the text or background do a different color, and then answer n/N to :keepbc or :keeptc, how can i make the color return to what it was before i changed the color, and returning to the respective :backcol/:textcol? for example:</p>
  
  <p><strong>background</strong>
  changing the background from black to blue via :backcol -> :keepbc; but then going to change it to a different color like red, but instead of saying y/Y in :keepbc, when i say n/N it changes the background color back to blue, and returns the :backcol.</p>
  
  <p><strong>text</strong>
  changing the text from  green(default) to blue via :textcol -> :keeptc; but then going to change it to a different color like red, but instead of saying y/Y in :keeptc, when i say n/N it changes the text color back to blue, and returns the :textcol.</p>
  
  <p>another problem is if i change the background color to blue, then change the text color, how do i get it to not change the background color back to black? when changing colors of either just the background, or just the text do i need to have the two characters? (02, 4F; like that)</p>
  
  <p>any ideas? thanks! and since im new if theres anything else you see wrong, please help me out! :D</p>
  
  <p>and ignore :premade! not done yet!</p>
  
  <pre><code>:start
  @echo off
  color 02
  
  :main
  @echo off
  if color==01 color 01
  if color==03 color 03
  if color==04 color 04
  if color==02 color 02
  title Tool Help
  echo What would you like to do?
  echo 1.Hide/Show
  echo 2.Settings
  echo 3.Exit
  set /p ans=
  if %ans%==1 GOTO folderhider
  if %ans%==2 GOTO settings
  if %ans%==3 EXIT /b
  
  :settings
  echo Please select and option.
  echo 1.Colors
  echo 2.Return to main
  set /p opt=
  if %opt%==1 GOTO coloro
  if %opt%==2 GOTO main
  
  :coloro
  @echo off
  echo 1.Background
  echo 2.Text
  echo 3.Nice pre-made schemes
  set opt=
  set /p opt=
  if %opt%==1 GOTO backcol
  if %opt%==2 GOTO textcol
  if %opt%==3 GOTO premade
  
  :backcol
  echo 1.Green
  echo 2.Blue
  echo 3.Aqua
  echo 4.Red
  echo 5.Cancel
  set input=
  set /p input=
  if %input%==1 color 20
  if %input%==2 color 10
  if %input%==3 color 30
  if %input%==4 color 40
  if %input%==5 GOTO settings
  GOTO keepbc
  
  
  :premade
  
  
  :textcol
  echo Select a color.
  echo 1.Green
  echo 2.Blue
  echo 3.Aqua
  echo 4.Red
  echo 5.Cancel
  set input=
  set /p input=
  if %input%==1 color 02
  if %input%==2 color 01
  if %input%==3 color 03
  if %input%==4 color 04
  if %input%==5 GOTO settings
  GOTO keeptc
  
  :keeptc
  echo Would you like to keep this setting? (Y/N)
  set ans=
  set /p ans=
  if %ans%==y GOTO settings
  if %ans%==Y GOTO settings
  if %ans%==n GOTO textcol
  if %ans%==N GOTO textcol
  GOTO textcol
  
  :keepbc
  echo Would you like to keep this setting? (Y/N)
  set ans=
  set /p ans=
  if %ans%==y GOTO settings
  if %ans%==Y GOTO settings
  if %ans%==n 
  if %ans%==N color 02
  GOTO backcol
  
  :folderhider
  @echo off
  echo 1.Show
  echo 2.Hide
  echo 3.Return
  set /p hj=
  if %hj%==1 GOTO sh
  if %hj%==2 GOTO hi
  if %hj%==3 GOTO main
  GOTO folderhider
  
  :hi
  set/p folderr=Please input the folder you want to hide. If none, type none. 
  if "%folderr%"==%folderr% GOTO confirm
  if "%folderr%"=="none" GOTO folderhider
  
  
  :confirm
  echo Are you sure you want to hide the folder(Y/N)
  set/p "cho=&gt;"
  if %cho%==y GOTO hider
  if %cho%==n GOTO hi
  if %cho%==Y GOTO hider
  if %cho%==N GOTO hi
  :hider
  attrib +r +h +s %folderr%
  echo Folder\File Hiden: %folderr% &gt;&gt;Folderandfileshiden.txt
  GOTO folderhider
  
  
  :sh
  set /p showern=Please input the folder you want to show 
  if "%showern%"==%showern% GOTO unlock
  
  :unlock
  echo Enter password to unlock folder
  set/p "pass=&gt;"
  if NOT %pass%== Blutackk11 GOTO fail
  if %pass%== Blutackk11 GOTO shower
  
  :fail
  echo Invalid pasword
  GOTO unlock
  
  if "%showern%"=="" GOTO folderhider
  
  :shower
  attrib -r -h -s %showern%
  GOTO folderhider
  </code></pre>