Since Windows Explorer (since at least Windows XP) has some basic support for ZIP files, it seems like there should be a command-line equivalent, but I can't seem to find any sign of one.
Does Windows (XP, Vista, 7, 8, 2003, 2008, 2013) ship with a built-in command-line zip tool, or do I need to stick with third-party tools?
It's not built into Windows, but it's in the Resource Kit Tools as
COMPRESS
,Examples:
Not that I'm aware of. As far as third party tools goes, 7zip has a pretty nice command line interface and the binary can be distributed with your app in the app's directory, so you don't have to rely on it being installed ahead of time.
Powershell does. See:
Compress Files with Windows PowerShell then package a Windows Vista Sidebar Gadget
.Net 4.5 has this functionality built in, and it can be leveraged by PowerShell. You'll need to be on Server 2012, Windows 8, or have .Net 4.5 installed manually.
Update - Build 1803 (March 2018)
Per What's new for the Command Line in Windows 10 version 1803, windows now ships with
tar.exe
built-in, which you can use like this:Further Reading
Another solution found on superuser site use windows native com object in .bat file:
Can you zip a file from the command prompt using ONLY Windows' built-in capability to zip files?
There is a single, simple PowerShell command for this. (PowerShell v5.0+)
To zip:
To unzip:
Sources:
Compress-Archive
Expand-Archive
Special thanks to @Ramhound