title: How to escape command line arguments correctly?
body: <p>I am working on a simple application which should encrypt a string given by the command line and then write it to the registry. Unfortunately I am having trouble if the password contains special characters like <code>" &amp; &lt; &gt; |</code> .So for example:</p>
  
  <pre><code>Encrypt.exe /Password:Password /reg       --&gt; works fine
  Encrypt.exe /Password:Password"&amp;&lt;&gt;| /reg  --&gt; the password variable contains: Password&amp;&lt;&gt;| /reg which is wrong
  Encrypt.exe /Password:Password&amp;&lt;&gt;|        --&gt; this outputs: "&gt; was unexpected at this time." but no idea where this text is coming from
  Encrypt.exe /Password:"Password&amp;&lt;&gt;|"      --&gt; this works, but note that the password can't contains a " char and the encrypted/decrypted string will contain a " at the beginning and at the end
  </code></pre>
  
  <p>So my question is, how do I pass the string <code>Password&amp;&lt;&gt;|</code> correctly to my application?</p>