1.

Solve : Zip a single file using winzip?

Answer»

For some reason i can not figure out how to jsut grab one file zip it. This command line grabs everything in the folder and zips it. am i missing something... I just want to grab the a single .jpg file and zip it?

The file is i want to zip is called 15.jpg
I also wanted to MOVE the zip file to another directory listed underneath...
C:\Documents and Settings\user1\My Pictures"

which i think the -m does but I'm not sure how to add it as well can someone help?

Code: [Select]
"C:\Program Files\WinZip\WINZIP32.EXE" -a "C:\Documents and Settings\user1\My Documents\New Folder\15.zip"

First of all .you can not use WinZip in DOS. It is a Windows program
PKZIP is free and runs in DOS.
http://pkzip.en.softonic.com/
Sorry, that is the wrong version...
Here is the DOS version.
http://www.pkware.com/software/pkzip/dosGeek, if daillest39 is able to run a program from C:\Program Files, then clearly they are talking about Windows command prompy and not "DOS".

WinZip supports command line options to add and extract from files.

When adding files the command format is:

[Path to]\winzip32.exe [-min] action [options] filename[.zip] files

where:

-min specifies that WinZip should run minimized. If -min is specified, it must be the first command line parameter.

action
-a for add, -f for freshen, -u for update, and -m for move. You must specify one (and only one) of these actions. The actions correspond to the actions described in the section titled "Add dialog box options" in the online manual.

options
-r corresponds to the Include subfolders checkbox in the Add dialog and CAUSES WinZip to add files from subfolders. Folder information is stored for files added from subfolders. If you add -p, WinZip will store folder information for all files added, not just for files from subfolders; the folder information will begin with the folder specified on the command line.

-ex, -en, -ef, -es, and -e0 determine the compression method: eXtra, Normal, Fast, Super fast, and no compression. The default is "Normal". -hs includes hidden and system files. Use -sPassword to specify a case-sensitive password. The password can be ENCLOSED in quotes, for example, -s"Secret Password".

filename.zip
Specifies the name of the Zip file involved. Be sure to use the FULL filename (including the folder).

files
Is a list of one or more files, or the @ character followed by the filename containing a list of files to add, one filename per line. Wildcards (e.g. *.bak) are allowed.

So,

In your SITUATION this would be the command line:

"C:\Program Files\WinZip\WINZIP32.EXE" -a "C:\Documents and Settings\user1\My Documents\New Folder\15.zip" "15.jpg"

If you want to then move the zip file to another folder, why don't you just specify that folder as the zip file destination?


@Salmon Trout

It worked perfect thank you Quote from: daillest319 on April 03, 2012, 01:20:53 PM

@Salmon Trout

It worked perfect thank you

All I did was type "winzip32.exe command line" into Google.
I have always just used the command line add on client.
http://www.winzip.com/downcl.htm
Most of our automated batch files use this where I work.


Discussion

No Comment Found