title: How to use -Xloggc with a Windows path containing spaces?
body: <p>The goal is to log the java garbage collection activities for each process that starts its own jvm.  Each log file will have its own unique name.  The process is started via a Windows (DOS) batch file.  The batch file contains:</p>
  
  <pre><code>set JVMLOG_DIR=%WORKING_DIR%logs\
  </code></pre>
  
  <p>where WORKING_DIR translates to:</p>
  
  <p><code>C:\Program Files (x86)\Directory\The Application Name\</code></p>
  
  <p>Subsequent lines append this to a variable containing java options:</p>
  
  <p><code>-Xloggc:%JVMLOG_DIR%Process__XX_jvm.log</code></p>
  
  <p>When it runs, the log is not created and this is reported in the process log:</p>
  
  <p><code>\Directory\The was unexpected at this time.</code></p>
  
  <p>I'm guessing the spaces or (x86) is causing the issue.</p>
  
  <p>Any ideas how to get it working or circumvent the limitation?</p>