Why doesn't Windows have a command-line zip command?

14,088

Why is there no command-line hook for this, like there is on Linux?

There actually is a PowerShell command you can use. You would simply do the following command to compress a file.

Compress-Archive -LiteralPath 'C:\Users\User\Desktop\Example\Test FIle.txt' -DestinationPath "C:\Users\User\Desktop\Example\Test.zip"

You would simply do the following command to uncompress that same archive.

Expand-Archive -LiteralPath "C:\Users\User\Desktop\Example\Test.Zip" -DestinationPath "C:\Users\User\Desktop\Example" -Force

Sources:

(I am aware of 3rd party tools, I am not interested in them

PowerShell is built into all modern versions of Windows. In this case the commands I am suggesting require PowerShell 5.0+

Share:
14,088

Related videos on Youtube

cowlinator
Author by

cowlinator

Why do so many popular answers on Stack Overflow consist of nothing other than some form of the question "why would you want to do that?"

Updated on September 18, 2022

Comments

  • cowlinator
    cowlinator over 1 year

    Windows has a built-in "zip" program for archiving and un-archiving files. It comes with every installation of Windows, and is even integrated with the Windows Explorer GUI.

    Why is there no command-line hook for this, like there is on Linux? This seems like such a large and basic oversight.

    (I am aware of 3rd party tools, I am not interested in them)

  • cowlinator
    cowlinator about 5 years
    This is a great answer! You should also post this answer on serverfault.com/questions/39071/…
  • Ramhound
    Ramhound about 5 years
    @cowlinator - Why would I submit a question on a different community? I am a member of this community? This question was within scope here at Super User. Besides, somebody already suggested PowerShell, as an answer to that question. I don't submit a duplicate answer to a question, nor do I submit the same answer, to multiple communities.
  • cowlinator
    cowlinator about 5 years
    That powershell answer is a lengthy powershell script. Don't worry about it, I will answer it then.