title: Unzip Password-protected files
body: <p>I am trying to extract files from a password-protected zip, in a USB drive, using PowerShell. I have looked up many ways but the easiest one doesn't seem to work.</p>
  
  <pre><code>$7ZipPath = "C:\Program Files\7-Zip\7z.exe"
  $zipFile = "E:\passwordprotectedtest.zip"
  $zipFilePassword = "Foo"
  
  &amp; $7ZipPath e -oE:\ -y -tzip -p "$zipFilePassword" "$zipFile"
  </code></pre>
  
  <p>I keep getting this error:</p>
  
  <pre class="lang-none prettyprint-override"><code>7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
  
  Error
  Cannot use absolute pathnames for this command
  </code></pre>
  
  <p>I then moved to the file to my desktop, changed <code>$zipFile = "passwordprotectedtest.zip"</code>, changed <code>-oE:\ to -oC:\</code>.</p>
  
  <p>That fixed the pathname error but started getting this error instead</p>
  
  <pre class="lang-none prettyprint-override"><code>7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
  
  Error
  Cannot find archive
  </code></pre>