Question: Need to execute the below winzip command in a java program.

```
C:\Program Files\WinZip>winzip32 -a -s"password" C:\abc.zip C:\abc.doc
```

Answer: 
Use [`Runtime#exec()`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runtime.html#exec(java.lang.String)) ([tutorial here](http://web.archive.org/web/20090806070132/http://java.sun.com/developer/JDCTechTips/2003/tt0304.html), [caveats here](http://web.archive.org/web/20100203124517/http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html)) or just pure Java code ([related SO topic](https://stackoverflow.com/questions/166340/write-a-password-protected-zip-file-in-java)).

By the way, if you didn't need password protection, you could just go ahead with [`java.util.zip`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/zip/package-summary.html) ([tutorial here](http://web.archive.org/web/20100826031009/http://java.sun.com/developer/technicalArticles/Programming/compression/)).
Taking a look around the internet, would this do what you're looking for: <https://truezip.dev.java.net/> without having to rely on an external install of WinZip which may or may not exist on the end user system? Just a suggestion.