title: Adding the current directory to Windows path permanently
body: <p>I am trying to add the current directory (from a command-line) to Windows path permanently, but I am having serious problems implementing this.</p>
  <p>My initial attempt was:</p>
  <pre><code>set PATH=%PATH%;%cd%
  </code></pre>
  <p>However, this only works in the current session; as soon as I close the command-line window, the <code>PATH</code> environment variable retains its previous value.</p>
  <p>Next, I tried:</p>
  <pre><code>setx PATH=%PATH%;%cd%
  </code></pre>
  <p>This might work in Windows 7 and 8 according to some of the answers that I found here, but in Windows 10, the <code>setx</code> command has three ways of working:</p>
  <pre><code>Syntax 1:
      SETX [/S system [/U [domain\]user [/P [password]]]] var value [/M]
  
  Syntax 2:
      SETX [/S system [/U [domain\]user [/P [password]]]] var /K regpath [/M]
  
  Syntax 3:
      SETX [/S system [/U [domain\]user [/P [password]]]]
           /F file {var {/A x,y | /R x,y string}[/M] | /X} [/D delimiters]
  </code></pre>
  <p>Long story short, I am unable to get it to work:</p>
  <pre><code>ERROR: Invalid syntax. Default option is not allowed more than '2' time(s).
  </code></pre>
  <p>How can I complete my goal the easiest way?</p>
  <p>If there's a different syntax per Windows version, then I'd be happy to get this info as well.</p>