title: Batch file to start new javaw process not working as expected
body: <p>I'm new to writing Windows batch file. I have the following batch file to start a new javaw process and redirect the output of the commands in the batch file to a log file. </p>
  
  <pre><code>@echo OFF
  
  call :sub &gt;start-demo.jar.cmd.log
  exit /b
  
  :sub
   echo starting demo.jar ..
   start "" javaw -jar demo.jar
   echo done ..
  </code></pre>
  
  <p>It's working fine and I can see that the output is redirected correctly to the log file and the javaw process is also started with a new process id when I execute the batch file. </p>
  
  <p>Here is the output redirected to the log file after the batch file is executed.</p>
  
  <pre><code>starting demo.jar ..
  done ..
  </code></pre>
  
  <p>However, when I try to edit or delete the log file after the batch file is executed, it says that the action can't be completed because the file is open in Java(TM) Platform SE binary.</p>
  
  <p>Only after killing the javaw process I'm able to edit or delete the log file.</p>
  
  <p>Not sure why this is happening and how to fix this. My expectation is that once the javaw process is started successfully, I should be able to edit or delete the log file. Is this correct?</p>
  
  <p>My OS is Windows 10 Enterprise 64 bit.</p>