title: Using CALL command with an IF condition in batch
body: <p>I'm trying to set up a code with passwords, where a different password will take you to a different directory. All the directories are in the same .bat file, but i want to use another .bat to call the passwords and take me to the directory. I'm not sure how to do it, and am finding it difficult to locate in the topic searches.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>@echo off
  :takemeto
  cls
  echo Enter Password
  set /p name=
  call C:\Users\Username\Desktop\Batch files\passwords.bat
  
  :password1
  cls
  echo You have chosen Password 1
  
  :password2
  cls
  echo You have chosen Password 2
  </code></pre>
  
  <p>The CALL is meant to locate and use my file with the passwords. the files has the passwords and the directories, which looks like this:</p>
  
  <pre><code>:Passwords
  if "%name%" == "password1" goto password1
  if "%name%" == "password2" goto password2
  /end
  </code></pre>
  
  <p>Hope this is clear,
  Thanks-Rob</p>