title: How to change the Path variable in ant exec task?
body: <p>I tried setting the <code>Path</code> variable <code>in ant exec</code> task using <a href="https://stackoverflow.com/questions/5607580/how-to-set-the-path-environment-variable-from-ant-script">this</a> link. But its not working somehow. I am trying to add <code>THRIFT_HOME</code> which is <code>set to basedir</code> currently and I have the <code>thrift.exe</code> file in the <code>basedir</code>.</p>
  
  <p>Also, when I change <code>executable attribute value</code> to <code>thrift.exe</code>, the thrift compiler works properly but the <code>basedir</code> is <code>not added</code> to the <code>Path</code>.</p>
  
  <pre><code>&lt;exec executable="thrift"&gt;
      &lt;env key="Path" value="${env.Path};${THRIFT_HOME}" /&gt;
  &lt;/exec&gt;
  </code></pre>
  
  <p>I also tried using the <code>setx</code> command as:</p>
  
  <pre><code>&lt;exec executable="setx"&gt;
      &lt;arg value="Path"/&gt;
      &lt;arg value="%Path%;${THRIFT_HOME}"/&gt;
  &lt;/exec&gt;
  </code></pre>
  
  <p>but it still does not work.</p>
  
  <p>Any help would be appreciated!</p>