labrys
labrys

Reputation: 149

Unzip with password (with native Windows zip)

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.

Upvotes: 2

Views: 8628

Answers (2)

AtomicFireball
AtomicFireball

Reputation: 339

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

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

Upvotes: -5

Jeff Zeitlin
Jeff Zeitlin

Reputation: 10809

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).

Upvotes: 0

Related Questions