title: Path system variable gets duplicated values when update via setx command
body: <p>My below .bat file add MySQL's bin directory to system PATH though the old PATH values get duplicated.</p>
  
  <pre><code>@echo off
  
  set pathMySQL=C:\xampp\mysql
  set p=%%
  
  setx MYSQL_HOME "%pathMySQL%"
  setx PATH "%p%MYSQL_HOME%p%\bin;%PATH%"
  </code></pre>
  
  <p>I expect the PATH value after this execution to be as below.</p>
  
  <blockquote>
    <p><strong>%MYSQL_HOME%\bin</strong>;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
    Files\TortoiseSVN\bin</p>
  </blockquote>
  
  <p>The actual value is as below - paths are repeated twice</p>
  
  <blockquote>
    <p><strong>%MYSQL_HOME%\bin</strong>;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
    Files\TortoiseSVN\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
    Files\TortoiseSVN\bin;</p>
  </blockquote>
  
  <p>What I did wrong? How can I get over this?</p>