Unzip with password (with native Windows zip)

7.5k views Asked by At

I've seen a great post on this site about using a PowerShell script to use a batch file to unzip a file:

How can you zip or unzip from the script using ONLY Windows' built-in capabilities?

But I cant find anywhere about how to use PowerShell with a password protected zip file using only Windows native zip - no 7-zip or likewise since I can't install stuff on my work machine.

Since I could not find it in Google I'm a little worried it's not possible.

2

There are 2 answers

4
Jeff Zeitlin On

In Windows 7 and later it is not possible; the password capabilities were removed. I have heard (but never confirmed) that this was instigated by the EU anti-Microsoft actions, claiming that it was anticompetitive (against WinZip et alia).

1
AtomicFireball On

PowerShell 5 has Expand-Archive where you can give a password to decompress it.

Expand-Archive <zipfile> -Password (Read-Host -AsSecureString -Prompt Password)