title: How to set PATH on Windows through R "shell" command
body: <p>I wish to add git to my PATH in Windows 7, through the "shell" command in R.</p>
  
  <pre><code>shell('set PATH=%PATH%;"C:\\Program%20Files%20(x86)\\Git\\bin"', intern = TRUE)
  shell("echo %PATH% ", intern= TRUE)
  </code></pre>
  
  <p>But I do not see that path added.</p>
  
  <p>If I run the above code in cmd.exe, it does add it to PATH.</p>
  
  <p>Any idea what is the issue?</p>
  
  <p>UPDATE:
  I ended up manually running the following through cmd.exe (which I made sure to run as admin)</p>
  
  <pre><code>setx PATH "C:\\Program Files (x86)\\Git\\bin"
  </code></pre>
  
  <p>Which worked. But I wish I could have done so through R. (maybe create a temp file and run it?)
  I then had to restart some programs to make sure they had been affected.</p>