Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PKZip25 - How to include the current folder to the files ?

345 views
Skip to first unread message

R.Wieser

unread,
Feb 27, 2009, 6:43:43 AM2/27/09
to
Hello all,

I'm trying to automate some packing using PKZip25, and would like to store
some files *including* the name of the folder they are in. But for some
reason I can't seem to find the right combination of arguments.

When I give PKZip25 the name of the folder it does not want to add the files
in them to the zipfile, and when I append a "\*.*" it will not add the
folders name to it.

Have I missed some secret handshake, or is PKZip25 just not able to do it ?
If it isn't, is there a version of PKZip which can ?

Regards,
Rudy Wieser

Robert Riebisch

unread,
Feb 27, 2009, 6:50:18 AM2/27/09
to
R.Wieser wrote:

> I'm trying to automate some packing using PKZip25, and would like to store
> some files *including* the name of the folder they are in. But for some
> reason I can't seem to find the right combination of arguments.

IIRC it's "-rP". For Info-Zip's Zip it's just "-r".

--
Robert Riebisch
Bitte NUR in der Newsgroup antworten!
Please reply to the Newsgroup ONLY!

Matthias Tacke

unread,
Feb 27, 2009, 8:06:56 AM2/27/09
to
Du weisst schon was bei "pkzip /?" erscheint?

Usage: PKZIP [options] zipfile [@list] [files...]

-a Add files
-b[drive] create temp zipfile on alternative drive
-d Delete files
-e[xx,x,n,f,s,0] Use [Extreme|eXtra|Normal (default)|Fast|Super fast|Store]
-f Freshen files
-l display software License agreement
-m[f,u] Move files [with Freshen | with Update]
-u Update files
-p|P store Pathnames|p=recursed into|P=specified & recursed into
-r Recurse subdirectories
-s[pwd] Scramble with password [If no pwd is given, prompt for pwd]
-v[b][r][m][t][c] View .ZIP [Brief][Reverse][More][Technical][Comment] sort by
[d,e,n,o,p,s] [Date|Extension|Name|natural Order(default)|Percentage|Size]
-&[f|u|l Span disks [Format|Unconditional format|Low density
h|w|v] High density|Wipe disk|enable dos Verify|
[s[drive]] Back up entire disk w/ subdirs (-rp) [drive to back up]]

*** For more information, please consult the user manual ***
Press 1 for basic options, 3 for advanced options, 4 for trouble shooting
options, any other key to quit help.

HTH
Grüße
Matthias

R.Wieser

unread,
Feb 27, 2009, 8:28:08 PM2/27/09
to
Hello Matthias.

> Du weisst schon was bei "pkzip /?" erscheint?
>
> Usage: PKZIP [options] zipfile [@list] [files...]

No, as I'm using (as mentioned in my initial post and in the subject-line)
PKZIP25. It returns, to that form of asking help, with : "PKZIP: (E4)
Unknown or illegal option - ?".

I've seen that message several times, as your suggestion is for me the
default thing to do when I need help to a command.

And yes, I've looked over that "help" and tried several combinations, even
"-dir(ectory)" and "-path" combinations (next to the "-rec(ursive)" one),
although they seem pretty-much the same and the example to the last one is
*at best* not helpfull at all (not distinctive to the other options to the
same argument).

Did *you* ever try to do what I cannot seem to be able to and succeeded ?
If not, why are you wasting my time like that ? :-(

Rudy Wieser.


-- Origional message
Matthias Tacke <Matt...@Tacke.de> schreef in berichtnieuws
go8s21...@news.tacke.de...


> R.Wieser wrote:
> > Hello all,
> >
> > I'm trying to automate some packing using PKZip25, and would like to
store
> > some files *including* the name of the folder they are in. But for some
> > reason I can't seem to find the right combination of arguments.
> >
> > When I give PKZip25 the name of the folder it does not want to add the
files
> > in them to the zipfile, and when I append a "\*.*" it will not add the
> > folders name to it.
> >
> > Have I missed some secret handshake, or is PKZip25 just not able to do
it ?
> > If it isn't, is there a version of PKZip which can ?
> >
> > Regards,
> > Rudy Wieser
> >
> Du weisst schon was bei "pkzip /?" erscheint?
>
> Usage: PKZIP [options] zipfile [@list] [files...]

<snip a help-file extract>

> HTH
> Grüße
> Matthias


dg1261

unread,
Feb 27, 2009, 10:13:08 PM2/27/09
to
"R.Wieser" <add...@not.available> wrote in
news:49a7d081$0$3578$e4fe...@dreader30.news.xs4all.nl:

> I'm trying to automate some packing using PKZip25, and would like to
> store
> some files *including* the name of the folder they are in. But for
> some reason I can't seem to find the right combination of arguments.


Rudy,

What version are you talking about? IIRC, there was a v2.50 update patch
for the DOS version, and a PKZip25.exe for Windows. It sounds like you're
referring to the Windows version, but we're in a DOS ng here.

Pkzip25.exe is at the heart of my automated daily backup routine (a batch
file running from a command-prompt window in XP), and it stores complete
pathnames. It runs from a Windows command-line, but not from real DOS.
The command syntax is completely different from the DOS versions.

If it's the Windows CLI version you're talking about, let me know and I'll
see if I can find my command reference.

Matthias Tacke

unread,
Feb 28, 2009, 9:45:30 AM2/28/09
to
R.Wieser wrote:
> Did *you* ever try to do what I cannot seem to be able to and succeeded ?
> If not, why are you wasting my time like that ? :-(
>
Oh dude,
I'm so sorry having used my worthless time to waste your precious one.

I couldn't guess you are asking a win32 console app question with the
same (internal) version number 2.50 as the DOS app version I posted.

Maybe your first posting should have been a bit more detailed?

Given the current Folder is named "1" all these archives do contain the
current folder name in the relative path.

pkzip25 -add -rec -dir=relative ..\1.zip ..\1\*.*
pkzip -a -r -P ..\2.zip ..\1\*.*
7z a -r ..\3.zip ..\1\*.*

I you want to determine the current folder in w2k/xp:
for %A in ("%CD%") do echo %~nxA

--
HTH
Regards
Matthias

R.Wieser

unread,
Mar 1, 2009, 4:42:14 AM3/1/09
to
Hello dg1261,

> What version are you talking about? IIRC, there was a v2.50 update
> patch for the DOS version, and a PKZip25.exe for Windows.

Yes, its the Windows console version I'm talking about. My appologies
about the confusion, I should have been more clear about it.

> It sounds like you're referring to the Windows version,
> but we're in a DOS ng here.

I did think about that before posting and thought that, as it is usable
(only!) from within a DOS Box and is not OS specific that this would be a
good place to ask for it (instead of posting them into the DOS newsgroups of
each OS version).

> If it's the Windows CLI version you're talking about, let me know
> and I'll see if I can find my command reference.

Yes, its the Windows CLI version. If you know how to do it it would make my
day.

If all else fails I could try to use a true DOS version instead, but am not
quite sure if such output is than still compatible with more recent
unpackers, like winzip.

Regards,
Rudy Wieser


-- Origional message
dg1261 <dgREMOVE...@cs.com> schreef in berichtnieuws
Xns9BBFC3831A3C8dg...@85.214.105.209...

R.Wieser

unread,
Mar 1, 2009, 5:13:41 AM3/1/09
to
Hello Matthias,

> Oh dude,
> I'm so sorry having used my worthless time to waste
> your precious one.

You mean that all-of-about 15 seconds it took you to copy and paste the
Help-output of a program ? In comparision to the time I did allready spend
in search-and-try of the correct combination that is laughable, so excuse me
if I did not respond in awe to it.

And thats apart from the fact that, if you really did think I could not find
that information, a simple explanation to how to use "/?" would have been
*way* more helpfull. Instead you simply "showed off" in a condescending
way.

> I couldn't guess you are asking a win32 console app question
> with the same (internal) version number 2.50 as the DOS app
> version I posted.

Yes, its the Windows CLI app I have problems with, and I see I could and
should have been more clear about that (better than using the exact
filename). My appologies for that.

> pkzip25 -add -rec -dir=relative ..\1.zip ..\1\*.*

Thanks, but that does not want to work. The directory as mentioned between
those last backslashes is not included in the zip file itself.

It would allso be nice if a/the solution would allso work on full pathnames
...

Regards,
Rudy Wieser


-- Origional message
Matthias Tacke <Matt...@Tacke.de> schreef in berichtnieuws

gobm6r...@news.tacke.de...

dg1261

unread,
Mar 2, 2009, 1:51:04 AM3/2/09
to
"R.Wieser" <add...@not.available> wrote in
news:49aa5e62$0$3209$e4fe...@dreader12.news.xs4all.nl:

> Yes, its the Windows CLI version. If you know how to do it it would
> make my day.

I use -dir=full and list files, as in this example, but it should work
jsut as well without list files:

pkzip25 -add -dir=full today.ZIP @group.txt

where group.txt is something like:

D:\Desktop\*.*
D:\Favorites\*.*
D:\My Documents\*.*

If you know the options you'd use from the DOS version, here's a
translation table. This cut-and-paste is from the help file, which
includes a html table with two columns, so this isn't going to line up
nice and pretty, but you should be able to make sense of it since there
are only two columns.


---------------------------------------------------
PKZIP Command Line Translation Table

PKZIP 2.04 Command: PKZIP 2.50 Command/Option
pkzip pkzip25 -add
-b<drive:path> -temp=drive:path
-c/-C -comment(all,unchanged,add,freshen,update,none)
-d -delete
-e[x|n|f|s|0] -level (0-9)
-ex -maximum
-en -normal
-ef -fast
-es -speed
-e0 -store
-f -freshen
-h -help
-i -add=incremental
-i- -add=-incremental
-j<h,r,s> -mask=all (hidden,system,readonly)
-J<h,r,s> -mask=none (default)
-k -zipdate=retain
-m[u|f] -move (with /add=update or /add=freshen)
-o -zipdate (newest,oldest,retain,none)
-p -path (current,relative,specify)
-P -path=full
-r -recurse
-rp/-rP -directories (current,full,relative,specify,none)
-s[password] -password (or -password=xxxx)
-t<date> -after=mmddyy (or mmddyyyy)
-T<date> -before=mmddyy (or mmddyyyy)
-u -add=update
-v -view (brief,details,normal)
-w<h,s>W<h,s> -attributes (hidden,system,readonly,all,none)
-x<filename -exclude=filename
-x@listfile -exclude=@listfile
-z -header
-& -span (to force if not detected)
-$[d] -volume=drive
pkunzip pkzip25 -extract
-c[m] -console (-more)
-d -directories
-e[r][c|d|e|n|p|s] -sort
(crc,date,extension,name,ratio,size,natural,none)
-f -extract=freshen
-h -help
-j<h,r,s> -mask=all (default) (hidden,system,readonly)
-J<h,r,s> -mask=none
-n -extract=freshen
-o -overwrite (prompt,all,never)
-p[a/b][c][#] -print
-s[password] -password (or -password=password)
-t -test (all,freshen,update)
-v -view (brief,details,normal)
-x<filespec> -exclude=filename
-x@listfile -exclude=@listfile

---------------------------------------------------

Here's more detail for the -dir option:


---------------------------------------------------
Name/Description:

directories

store directory path names during compression, or recreate directory path
names while extracting

includes subdirectories (recurse)

note: using this command is the same as combining the path and recurse
commands


---------------------------------------------------
Value(s):

current - store path information relative to the current path

root or full - store the entire path beginning at the root directory

specify - store the path information for each file being compressed (or
recreates for each file being extracted), as specified on the command
line

relative - store the directory path relative to the current working
directory of the drive(s) specified (DOS)

none - overrides directory path information in configuration file

Defaults:

default = none

default if used on command line without a sub-option = current

---------------------------------------------------
Example usage:

compression example (assumes you are in "/wp"):

pkzip25 -add -dir=root save.zip wp/docs/*

the path stored would be "wp/docs/*"

pkzip25 -add -dir=current save.zip wp/docs/*

the path stored would be: "docs/*"

extraction example:

pkzip25 -ext -direct save.zip /*

note: UNIX users should utilize the include option or place quotation
marks around wildcard designations to bypass automatic wildcard expansion
by the shell, which may restrict your pattern search

---------------------------------------------------

R.Wieser

unread,
Mar 2, 2009, 2:40:03 AM3/2/09
to
Hello dg1261,

> I use -dir=full and list files, as in this example, but it should work
> jsut as well without list files:

Alas, the "full" means that the whole path (though without a drive-letter)
is stored, and I need it to store the last foldername mentioned in the
command only (and than the files/folders below it ofcourse).

Reason: When the data is unpacked it should be stored in its own folder
instead of, when not providing a target path, the current one.

I just thought of something : As a work-around I could change the current
working directory to the parent one of the one I would like to include into
the ZIP, and than use "-dir=relative".

Now all I have to find out how to switch to that path and after having
executed the zipping switch back again ...

Regards,
Rudy Wieser


-- Origional message
dg1261 <dgREMOVE...@cs.com> schreef in berichtnieuws

Xns9BC1E875CB4C4dg...@85.214.105.209...

pe...@nospam.demon.co.uk

unread,
Mar 2, 2009, 12:21:46 PM3/2/09
to
In article <49ab8bdf$0$3498$e4fe...@dreader22.news.xs4all.nl>
add...@not.available "R.Wieser" writes:

> Hello dg1261,
>
> > I use -dir=full and list files, as in this example, but it should work
> > jsut as well without list files:
>
> Alas, the "full" means that the whole path (though without a drive-letter)
> is stored, and I need it to store the last foldername mentioned in the
> command only (and than the files/folders below it ofcourse).
>
> Reason: When the data is unpacked it should be stored in its own folder
> instead of, when not providing a target path, the current one.
>
> I just thought of something : As a work-around I could change the current
> working directory to the parent one of the one I would like to include into
> the ZIP, and than use "-dir=relative".
>
> Now all I have to find out how to switch to that path and after having
> executed the zipping switch back again ...
>
> Regards,
> Rudy Wieser

If you can't get "-dir=relative" to work, you could try using
SUBST to assign a drive letter to the required directory and use
"-dir=full" on that.

I have no experience of PKZip25 (only PKZIP 2.5 for DOS), so
don't know if this will do what you want, but SUBST is a very
useful command for doing this sort of thing so it should.

Pete

--
"We have not inherited the earth from our ancestors,
we have borrowed it from our descendants."

R.Wieser

unread,
Mar 2, 2009, 1:51:57 PM3/2/09
to
Hello pete,

> If you can't get "-dir=relative" to work, you could try using
> SUBST to assign a drive letter to the required directory and use
> "-dir=full" on that.

:-) I never thought of using that, but it sounds like something I should
definitily try. Thanks.

Regards,
Rudy Wieser


-- Origional message
<pe...@nospam.demon.co.uk> schreef in berichtnieuws
123601...@nospam.demon.co.uk...

Rugxulo

unread,
Mar 14, 2009, 11:06:20 PM3/14/09
to
Hi,

On Mar 2, 2:40 am, "R.Wieser" <addr...@not.available> wrote:
>
> I just thought of something : As a work-around I could change the current
> working directory to the parent one of the one I would like to include into
> the ZIP, and than use "-dir=relative".
>
> Now all I have to find out how to switch to that path and after having
> executed the zipping switch back again ...

Try "pushd c:\whatever" and "popd". :-)

Richard Bonner

unread,
Apr 1, 2009, 7:35:25 PM4/1/09
to
Rugxulo (rug...@gmail.com) wrote:

> On Mar 2, 2:40=A0am, "R.Wieser" <addr...@not.available> wrote:
> >
> > I just thought of something : As a work-around I could change the current

> > working directory to the parent one of the one I would like to include in=
> > to the ZIP, and than use "-dir=3Drelative".


> >
> > Now all I have to find out how to switch to that path and after having
> > executed the zipping switch back again ...

> Try "pushd c:\whatever" and "popd". :-)

*** Leaving the current directory is unnecessary if paths are
included with the ZIP commands.

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

R.Wieser

unread,
Apr 2, 2009, 2:33:45 AM4/2/09
to
Hello Richard

> *** Leaving the current directory is unnecessary if
> paths are included with the ZIP commands.

Even if I only want to have a relative path, starting with name of the
folder you start the compression in (and not the whole, absolute path) ?
<whistle>

Yes, we allready talked about that and I think I tried about every option
and combination of arguments PKZip25.exe offered.

But if you know how to do it than feel free to post the method. I would
still like to know.

Regards,
Rudy Wieser


-- Origional message
Richard Bonner <ak...@chebucto.ns.ca> schreef in berichtnieuws
gr0tnt$590$2...@Kil-nws-1.UCIS.Dal.Ca...

Richard Bonner

unread,
Apr 3, 2009, 12:53:03 PM4/3/09
to
R.Wieser (add...@not.available) wrote:

> > Richard said:
> > *** Leaving the current directory is unnecessary if
> > paths are included with the ZIP commands.

> Even if I only want to have a relative path, starting with name of the
> folder you start the compression in (and not the whole, absolute path) ?
> <whistle>

*** You can start in the directory to be zipped, but one can run the
command from anywhere if paths are included.


> Yes, we allready talked about that and I think I tried about every option
> and combination of arguments PKZip25.exe offered.

> But if you know how to do it than feel free to post the method. I would
> still like to know.
>

> Rudy Wieser

*** I can't help you for Windows, but in PKZIP 2.50 for DOS it's:

PKZIP -rP D:\BACKUP\TEST.ZIP C:\DOCUMENT\*.*

That will create an archive called "TEST.zip" in the BACKUP directory
on the `D' drive. The files within that archive will come from the files
in the "DOCUMENT" directory on the `C' drive. It will include the latter's
subdirectories and their files, as well, because the switch `-rP' was
used. That switch will cause PKZIP to recurse the directory tree under
"DOCUMENT" so as to include all its files and their paths in the .zip
archive.

Essentially the command means to make a zip archive on the `D'
drive containing all the files in the "DOCUMENT" directory and below.
--------


To restore that archive with all files and full paths to a TEST
directory on Drive `E', issue this:

PKUNZIP -d D:\BACKUP\TEST.ZIP E:\OLD

This command means to expand the TEST.zip archive into the "OLD"
directory and include all files and their paths. PKZIP will recreate
the entire tree of the "DOCUMENT" directory within the "TEST" directory
as:

E:\OLD\DOCUMENT...
--------

PKZIP and PKUNZIP must be in your path or you must include paths to
them in the commands. Realise too, that PKZIP's switches are case
sensitive, so issue those switches as seen in the above examples.


I use PKZIP/UNZIP every day. They handle all my backup and restore
functions for all my systems. At one time before DOS had adequate COPY and
MOVE commands, I used PKZIP to copy or move entire trees. Now XXCOPY
handles all that. (-:

One or more links to websites
for the referred program(s)
can be found at:

http://www.chebucto.ca/~ak621/DOS/Websites.html

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

R.Wieser

unread,
Apr 3, 2009, 8:33:39 PM4/3/09
to
Hello Richard,

> PKZIP -rP D:\BACKUP\TEST.ZIP C:\DOCUMENT\*.*

I'm sorry, but it throws an error on the "rP" option.

Just to make sure that we are talking about the same version here is the
header of the version I'm using :

PKZIP(R) Version 2.50 FAST! Compression Utility for Windows 95/NT
4-15-1998
Copyright 1989-1998 PKWARE Inc. All Rights Reserved. Shareware Version
PKZIP Reg. U.S. Pat. and Tm. Off. Patent No. 5,051,745

> *** I can't help you for Windows, but in PKZIP 2.50 for DOS it's:

As far as I can determine we are talking about the same version. Why does
yours do something mine is not ?

Regards,
Rudy Wieser


-- Origional message
Richard Bonner <ak...@chebucto.ns.ca> schreef in berichtnieuws

gr5etf$ktm$1...@Kil-nws-1.UCIS.Dal.Ca...

Richard Bonner

unread,
Apr 11, 2009, 7:56:26 AM4/11/09
to
R.Wieser (add...@not.available) wrote:

> > Richard said:
> > PKZIP -rP D:\BACKUP\TEST.ZIP C:\DOCUMENT\*.*

> I'm sorry, but it throws an error on the "rP" option.

> Just to make sure that we are talking about the same version here is the
> header of the version I'm using :

> PKZIP(R) Version 2.50 FAST! Compression Utility for Windows 95/NT
> 4-15-1998
> Copyright 1989-1998 PKWARE Inc. All Rights Reserved. Shareware Version
> PKZIP Reg. U.S. Pat. and Tm. Off. Patent No. 5,051,745

> > *** I can't help you for Windows, but in PKZIP 2.50 for DOS it's:

> As far as I can determine we are talking about the same version. Why does
> yours do something mine is not ?
>

> Rudy Wieser

*** I assume it's because the DOS and Windows versions are
different. I also have a registered version, so there may be a difference
between it and the shareware version. I doubt the latter and suspect the
former, so try typing this:

PKZIP -h

or

PKZIP -?

If it works, you will see the switches available.

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

R.Wieser

unread,
Apr 11, 2009, 11:46:33 AM4/11/09
to
Hello Richard,

I'm sorry, but the help of my version is reached by typing the filename
alone, no arguments. Specific help can than be gotten by typing one of the
commands shown in the displayed list. Help is terminated by pressing
ESCape.

I get the feeling that, although both versions have version-number 2.50,
they are quite different. Not as in comparable in usage but the Windows
version has got some long-filename support, but *really* different.
Including the dropping of/not yet having support for that rD switch.

Regards,
Rudy Wieser

Richard Bonner <ak...@chebucto.ns.ca> schreef in berichtnieuws

grq0ha$glg$3...@Kil-nws-1.UCIS.Dal.Ca...

Richard Bonner

unread,
Apr 12, 2009, 1:48:02 PM4/12/09
to
R.Wieser (add...@not.available) wrote:
> I'm sorry, but the help of my version is reached by typing the filename
> alone, no arguments.

*** That works in the DOS version, too.


(Snip)


> I get the feeling that, although both versions have version-number 2.50,
> they are quite different. Not as in comparable in usage but the Windows
> version has got some long-filename support, but *really* different.
> Including the dropping of/not yet having support for that rD switch.
>

> Rudy Wieser

*** Did you mean the `rP' switch?

Regardless, it's certainly possible that PKWARE changed the switches
in the Windows version. I have only ever used the DOS version.

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

R.Wieser

unread,
Apr 13, 2009, 3:28:20 AM4/13/09
to
Hello Richard,

> *** That works in the DOS version, too.

But the -h and -? switches that work in your DOS version do not work in
mine.

> *** Did you mean the `rP' switch?

I'm sorry, yes. I probably mixed up Path and Directory when writing that
...

> Regardless, it's certainly possible that PKWARE changed the
> switches in the Windows version. I have only ever used the
> DOS version.

As my version is command-line only I allways regarded it as a DOS version,
but with long filename support (which I need). I think I'll take a look at
the real DOS version to see what it can do for me.

Regards,
Rudy Wieser


-- Origional message


Richard Bonner <ak...@chebucto.ns.ca> schreef in berichtnieuws

grt9gi$ge2$1...@Kil-nws-1.UCIS.Dal.Ca...

Richard Bonner

unread,
May 7, 2009, 8:48:39 AM5/7/09
to
R.Wieser (add...@not.available) wrote:
> Hello Richard,

> > *** That works in the DOS version, too.

> But the -h and -? switches that work in your DOS version do not work in
> mine.

*** Then PK Ware must have changed it between the DOS and Windows
versions.


> > Regardless, it's certainly possible that PKWARE changed the
> > switches in the Windows version. I have only ever used the
> > DOS version.

> As my version is command-line only I allways regarded it as a DOS version,
> but with long filename support (which I need).

*** The Windows command line is not DOS. It looks and acts in a similar
manner, but it is not the same.


> I think I'll take a look at the real DOS version to see what it can
> do for me.
>

> Rudy Wieser

*** I can't believe that PK Ware would eliminate some features for a
Windows version, but I would be interested to know how they differ.

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

0 new messages