title: How to prevent batch window from closing when error occurs?
body: <p>I'm trying to write batch script to <strong>create a folder if it does not already exist</strong>.
  Following up the online examples, below is my script.</p>
  
  <p>The problem is; first <code>pause</code> works, then probably due to syntax error <strong>the window closes</strong> even before reaches to the second <code>pause</code>, so I can't really tell which part of my script is wrong.</p>
  
  <p>Could anyone show me how to prevent closing window so that I can see what's on the window?</p>
  
  <pre><code>@echo off
  
  :copy theme images over
  :designer
  echo copying theme images over...
  pause
  if not exist "%K2DIR%\K2 SmartForms Runtime\Styles\Themes\Sharepoint 2013\rich_text"
  (
      md "%K2DIR%\K2 SmartForms Runtime\Styles\Themes\Sharepoint 2013\rich_text333"
  )
  
  pause
  </code></pre>