title: How to stop a .bat process from within
body: <p>So, I have a program for the Windows Command Prompt, which is for changing the directory (so I can go to a language directory without having to do cd everytime)
  and I want to kill it after I select an option. However, I have tried some
  methods, which do one of the following:</p>
  
  <p><strong>a.</strong> taskkill /IM ... (blows up with a process not found error)</p>
  
  <p>and</p>
  
  <p><strong>b.</strong> exit [<em>as shown here</em>] (does what I want, but it also closes the command prompt)</p>
  
  <p>This is my program (the important part):</p>
  
  <pre><code>:C++
  cd C:\Users\S.G.\Documents\C++ Scripts
  echo What's in C++ Scripts:
  dir
  pause
  exit
  
  :Python
  cd C:\Users\S.G.\AppData\Local\Programs\Python\Python36-32
  echo What's in Python:
  dir
  exit
  </code></pre>
  
  <p>The reason why I'm stuck as to how one does this is because say I choose option "C++".
  If I choose it, it runs what I have described, but it also runs the "Python" function. If I run the "Python"function however, it runs fine and doesn't display whatever's in the "C++" function.</p>
  
  <p>Why is function "C++" also running "Python" when I intend not to?</p>