title: 7z cli - how to pass a password with whitespaces?
body: <p>How to pass a password with whitespaces to the 7z cli argument <code>-p</code>?</p>
  
  <p>I want to use the cli to extract a archive with a password. The p-argument is a bit ugly, because you have to write the password directly after the argument. </p>
  
  <p><a href="https://sevenzip.osdn.jp/chm/cmdline/switches/password.htm" rel="nofollow noreferrer">https://sevenzip.osdn.jp/chm/cmdline/switches/password.htm</a></p>
  
  <p>Following does not work:</p>
  
  <pre><code>7z t test.zip -pmy password
  7z t test.zip -p="my password"
  </code></pre>
  
  <p>Following works, but with limitation:</p>
  
  <pre><code>7z t test.zip -p"my password"
  </code></pre>
  
  <p>The limitation is your password should not include quotes. Example the following will fail. The password is: <code>"evil quotes"</code></p>
  
  <pre><code>7z t test.zip -p""evil quotes""
  </code></pre>
  
  <p>Because the password is now empty. </p>
  
  <p><strong>Is there a way to pass a safe string for the password?</strong></p>
  
  <p>The cli command is generated by JavaScript (NodeJS, exec) not manually executed in cli (windows).</p>