ZIP command line options in XP


Recommended Posts

Is there any way, by default, to use command line options to add files and folders to a zip file in Windows XP (meaning, using XP's built in Compressed Files feature instead of installing WinZIP, etc.)? Thanks.

Link to comment
Share on other sites

I understood you to say you wanted to use the native XP method for compressed files. As far as I know, XP treats a.zip file like a compressed folder.

I happen to have Winzip installed, and usually use that to open a .zip file. However if I right click on a .zip file in Windows Exploer and click Explore, it opens like a subfolder in Windows Explorer.

So I think the compact command should work.

Oops, just tried, it does not work to add a file to a .zip file. It does work to add and compress a file to a compressed folder.

Edited by JRosenfeld
Link to comment
Share on other sites

now i'm severly interested in this.

humm...

opening the compressed folder view (explorer):

rundll32.exe zipfldr.dll,RouteTheCall [Zipfile].zip

I'm gonna spend some time looking for of this up to see if there are other calls available.

Edited by bigflavor
Link to comment
Share on other sites

alright... after some long investigating i figured out that there is no way to run this via command line, even rundlling the dll file.

Any programming examples i found (I was hoping to write up a quick vbscript to use) simulate a drop-target function, and call the CLSID of the send-to folder shortcut thing.

Oh microsoft, you've failed us again. I mean, it's another stupid little thing that it would take a single microsoft programmer a day to bang out a DLL, or even an gui executable, or command line... but noooooo they wouldn't've wanted to do that.

maybe for vista. PowerShell?

Link to comment
Share on other sites

  • 1 year later...

Um, who said xp did not support compressed folders from the command line?

C:\>compress /?

Syntax:

COMPRESS [-R] [-D] [-S] [ -Z | -ZX ] Source Destination

COMPRESS -R [-D] [-S] [ -Z | -ZX ] Source [Destination]

Description:

Compresses one or more files.

Parameter List:

-R Rename compressed files.

-D Update compressed files only if out of date.

-S Suppress copyright information.

-ZX LZX compression. This is default compression.

-Z MS-ZIP compression.

Source Source file specification. Wildcards may be

used.

Destination Destination file | path specification.

Destination may be a directory. If Source is

multiple files and -r is not specified,

Destination must be a directory.

Examples:

COMPRESS temp.txt compressed.txt

COMPRESS -R *.*

COMPRESS -R *.exe *.dll compressed_dir

edit: grab the 2k3 resource kit and it does ;)

http://www.microsoft.com/downloads/details...;displaylang=en

But it might be easier -- and clearly more features to just use a FREE tool like 7z

C:\>7z

7-Zip 4.42 Copyright ? 1999-2006 Igor Pavlov 2006-05-14

Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]

[<@listfiles...>]

<Commands>

a: Add files to archive

d: Delete files from archive

e: Extract files from archive (without using directory names)

l: List contents of archive

t: Test integrity of archive

u: Update files to archive

x: eXtract files with full paths

<Switches>

-ai[r[-|0]]{@listfile|!wildcard}: Include archives

-ax[r[-|0]]{@listfile|!wildcard}: eXclude archives

-bd: Disable percentage indicator

-i[r[-|0]]{@listfile|!wildcard}: Include filenames

-m{Parameters}: set compression Method

-o{Directory}: set Output directory

-p{Password}: set Password

-r[-|0]: Recurse subdirectories

-scs{UTF-8 | WIN | DOS}: set charset for list files

-sfx[{name}]: Create SFX archive

-si[{name}]: read data from stdin

-slt: show technical information for l (List) command

-so: write data to stdout

-t{Type}: Set type of archive

-v{Size}[b|k|m|g]: Create volumes

-u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options

-w[{path}]: assign Work directory. Empty path means a temporary directory

-x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames

-y: assume Yes on all queries

Edited by BudMan
Link to comment
Share on other sites

Where is this compress exe? I run cmd type compress with the needed params - not found. Is this part of XP? Can't find it - searched c:

Link to comment
Share on other sites

Like I said you need to download the resource kit for 2k3.. which is FREE. But you know upon further playing with it and its not very good. I would highly suggest the user just bite the bullet and use a external program.. ie 7zip is FREE for all uses personal and work, etc.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.