Executing WinZip Command in a C# Program

Someone asked on Stack Overflow:

How to execute winzip command from MVC controller Action?

Command:

C:\Program Files (x86)\WinZip>WZZIP.EXE -ys2048000 Location Location

I posted the following answer, which was chosen as the accepted answer and received 1 upvote:

What you are asking, directly is possible with the System.Diagnostics.Process.Start(string, string) method. It would look something like this:

System.Diagnostics.Process.Start(
    @"C:\Program Files (x86)\WinZip\WZZIP.EXE", 
    "-ys2048000 Location Location");

I’ve gone down this path and for simple things it is probably good enough. I’ve often found that there are usually more cool, useful things you can do interacting directly with the zip files. In that case, something like DotNetZip or SharpZip are probably good alternatives. I’ve used DotNetZip before, its very robust and highly performant.

Here’s a quick example from DotNetZip home page:

Here’s some C# code that creates a zip file.

using (ZipFile zip = new ZipFile())
{
    // add this map file into the "images" directory in the zip archive
    zip.AddFile("c:\\images\\personal\\7440-N49th.png", "images");
    // add the report into a different directory in the archive
    zip.AddFile("c:\\Reports\\2008-Regional-Sales-Report.pdf", "files");
    zip.AddFile("ReadMe.txt");
    zip.Save("MyZipFile.zip");
}
Notable comments

Nate (0 upvotes): @SahilGupta I’m not sure what you mean, only licensed version. DotNetZip is Microsoft Public License (Ms-PL).


Originally posted on Stack Overflow — 1 upvotes (accepted answer). Licensed under CC BY-SA.

signed letter b

Dad. Geek. Gamer. Software developer. Cloud user. Old Car enthusiast.  Blogger.


Top Posts


profile for Nate on Stack Exchange, a network of free, community-driven Q&A sites
a proud member of the blue team of 512KB club
Thoughts, opinions, and ideas shared here are my own. © 2026 Nate Bross.