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

ZIP a folder using a Batch File

55 views
Skip to first unread message

dr.j.r....@gmail.com

unread,
Nov 1, 2017, 7:00:43 PM11/1/17
to
I have a Batch file, for Win XP and hopefully higher, which creates, on a USB memory stick, a single folder FRED containing a selection of data files from the originating Windows C drive.

I can see, but not remember, how to copy the folder FRED and all of its contents into a compressed folder PETE, by poking Windows with the mouse in suitable places.

So I want a batch file WILL.BAT which, called with arguments FRED and PETE, with FRED already created, will give me a corresponding compressed folder PETE, whether or not PETE already exists. I can then, I suppose, E-mail PETE as a single attachment. The delivered PETE must, with simple mouse-poking of the recipient Windows, produce a folder matching the original FRED.

I'm thinking of ZIP compression, but the type and efficiency are not important; but both packing and unpacking must use native windows features.

I know not where to start ...

--
(c) John Stockton, near London, UK. Using Google, no spell-check. |
Mail: J.R.""""""""@physics.org |

Zaidy036

unread,
Nov 2, 2017, 2:28:18 AM11/2/17
to
<dr.j.r....@gmail.com> wrote:
> I have a Batch file, for Win XP and hopefully higher, which creates, on a
> USB memory stick, a single folder FRED containing a selection of data
> files from the originating Windows C drive.
>
> I can see, but not remember, how to copy the folder FRED and all of its
> contents into a compressed folder PETE, by poking Windows with the mouse
> in suitable places.
>
> So I want a batch file WILL.BAT which, called with arguments FRED and
> PETE, with FRED already created, will give me a corresponding compressed
> folder PETE, whether or not PETE already exists. I can then, I suppose,
> E-mail PETE as a single attachment. The delivered PETE must, with simple
> mouse-poking of the recipient Windows, produce a folder matching the original FRED.
>
> I'm thinking of ZIP compression, but the type and efficiency are not
> important; but both packing and unpacking must use native windows features.
>
> I know not where to start ...
>

7zip has batch commands

--
Zaidy036

Todd Vargo

unread,
Nov 2, 2017, 4:50:57 AM11/2/17
to
On 11/1/2017 7:00 PM, dr.j.r....@gmail.com wrote:
> I have a Batch file, for Win XP and hopefully higher, which creates, on a USB memory stick, a single folder FRED containing a selection of data files from the originating Windows C drive.
>
> I can see, but not remember, how to copy the folder FRED and all of its contents into a compressed folder PETE, by poking Windows with the mouse in suitable places.
>
> So I want a batch file WILL.BAT which, called with arguments FRED and PETE, with FRED already created, will give me a corresponding compressed folder PETE, whether or not PETE already exists. I can then, I suppose, E-mail PETE as a single attachment. The delivered PETE must, with simple mouse-poking of the recipient Windows, produce a folder matching the original FRED.
>
> I'm thinking of ZIP compression, but the type and efficiency are not important; but both packing and unpacking must use native windows features.
>
> I know not where to start ...
>

LOL, you've become too lazy to start.

With a little research, and effort, you could author a batch utilizing
WSH/VBScript to perform the actions noted above on Windows XP and
hopefully higher.

OTOH, you can see FRED which contains the files that you want to email.
By simply right clicking on FRED and selecting "SendTo" from the list
and then "Compressed (zipped) folder" from the next list, you can easily
create a ZIP of FRED as you once-upon-a-time remembered.

Since unpacking is built into Windows XP and hopefully higher, email
recipients wont need a batch.

Good luck and happy batching.

JJ

unread,
Nov 2, 2017, 8:48:27 AM11/2/17
to
On Wed, 1 Nov 2017 16:00:42 -0700 (PDT), dr.j.r....@gmail.com wrote:
>
> I'm thinking of ZIP compression, but the type and efficiency are not
> important; but both packing and unpacking must use native windows
> features.

While the Windows built in ZIP feature is accessible from a batch file, it's
impossible to know when the un/packing process actually ends.

Zaidy036

unread,
Nov 2, 2017, 8:50:57 AM11/2/17
to
START “” /WAIT .......

--
Zaidy036

dr.j.r....@gmail.com

unread,
Nov 2, 2017, 9:08:36 AM11/2/17
to
On Thursday, 2 November 2017 06:28:18 UTC, Zaidy036 wrote:
> JRS wrote:

> > ... but both packing and unpacking must use native windows features.

> 7zip has batch commands

7zip is not native.

dr.j.r....@gmail.com

unread,
Nov 2, 2017, 9:28:43 AM11/2/17
to
On Thursday, 2 November 2017 08:50:57 UTC, Todd Vargo wrote:
> On 11/1/2017 7:00 PM, JRS wrote:


> > So I want a batch file ...
^^^^^^^^^^

> OTOH, you can see FRED which contains the files that you want to email.
> By simply right clicking on FRED ...

> Since unpacking is built into Windows XP and hopefully higher, email
> recipients wont need a batch.

Yes; I never anything against Windows unwrapping. Recipients can read the packed text /in/ apparent /situ/, and can drag-copy PETE to be unpacked in an ordinary folder (expected: now tested, but only in XP).

dr.j.r....@gmail.com

unread,
Nov 2, 2017, 9:33:33 AM11/2/17
to
On Thursday, 2 November 2017 12:48:27 UTC, JJ wrote:
> On Wed, 1 Nov 2017 16:00:42 -0700 (PDT), JRS wrote:
> >
> > I'm thinking of ZIP compression, but the type and efficiency are not
> > important; but both packing and unpacking must use native windows
> > features.
>
> While the Windows built in ZIP feature is accessible from a batch file, it's
> impossible to know when the un/packing process actually ends.

For the envisaged ZIP size, the unpacking will be near enough
instantaneous. The result will not be used electronically-
immediately, but only manually-soon.

npocmaka

unread,
Nov 2, 2017, 10:51:58 AM11/2/17
to

dr.j.r....@gmail.com

unread,
Nov 2, 2017, 12:52:40 PM11/2/17
to
On Thursday, 2 November 2017 14:51:58 UTC, npocmaka wrote:
> On Thursday, November 2, 2017 at 1:00:43 AM UTC+2, dr.j.r....@gmail.com wrote:

> ...

> > So I want a batch file WILL.BAT which, called with arguments FRED and PETE, with FRED already created, will give me a corresponding compressed folder PETE, whether or not PETE already exists. I can then, I suppose, E-mail PETE as a single attachment. The delivered PETE must, with simple mouse-poking of the recipient Windows, produce a folder matching the original FRED.

Thanks. I had not, but now have, and have noted it. The answer
appears to be "not easily"

The need is for a process that only requires me to remember
what to type on the initial command line, and then requires
little interaction and no further use of cranial memory.

I can indeed, in WinXP, with a few clicks, copy a folder into a
compressed folder on the USB ... But WinXP seems to think
that the compressed folder is a 1.44MB floppy disc - when
it has copied that much, it asks for a further disc.

The pragmatical answer therefore seems to be to append, to the
existing code which selects and copies into D:\FRED, some echo
commands which tell me how to make the compressed-single-file
copy using Windows 7, which does not have the 1.44MB limitation.

I would be happy to automatically get both the uncompressed and
the compressed versions every time, but usually I will not need
the compressed one.

Zaidy036

unread,
Nov 2, 2017, 2:09:26 PM11/2/17
to
Why not use AutoIt or PTFBpro? An extra process on your machine but the
operations would be carried out using Win functions.


--
Zaidy036

Zaidy036

unread,
Nov 2, 2017, 2:17:22 PM11/2/17
to

JJ

unread,
Nov 3, 2017, 8:19:25 AM11/3/17
to
That doesn't actually tell that the ZIP process has already completed.

(PeteCresswell)

unread,
Nov 3, 2017, 6:07:11 PM11/3/17
to
Per dr.j.r....@gmail.com:
>I'm thinking of ZIP compression, but the type and efficiency are not important; but both packing and unpacking must use native windows features.
>
>I know not where to start ...

For WinZip, you need the CommandLineExtensions add-on

The installer I have is called:
ezcline23(command line extension 11.2).exe

There is another one for 11.1 - same name except...

Then you need to write a .bat file to do the deed.

Here's one I use. I drag/drop a folder containing
the files I want zipped on to the .bat file icon or
shortcut and it does it's thing.

This one zips it into an encrypted zip file with
password "XXXXX".
=====================================================
:* --------------------------------------------
:* Purpose: - To create a secured zip file on
:* drive E: from whatever is dropped on
:* to the shortcut for this batch file.
:* Notes: - Folder names are tb preserved
:* - Work files are tb written to C:\Temp

"c:\program files (X86)\winzip\wzzip.exe" -a -sXXXXX -ycAES256
-bC:\Temp "E:\%~n1.zip" "%~d1%~p1%~n1.zip" %1

PAUSE
=====================================================
--
Pete Cresswell

(PeteCresswell)

unread,
Nov 4, 2017, 5:26:07 PM11/4/17
to
Per (PeteCresswell):
>ezcline23

Oops! SHB wzcline23
--
Pete Cresswell

Todd Vargo

unread,
Nov 10, 2017, 6:08:57 AM11/10/17
to
On 11/2/2017 9:28 AM, dr.j.r....@gmail.com wrote:
> On Thursday, 2 November 2017 08:50:57 UTC, Todd Vargo wrote:
>> On 11/1/2017 7:00 PM, JRS wrote:
>
>
>>> So I want a batch file ...
> ^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^

So what have you written so far applicable to your query.

Any effort at all? Doubtful.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)

Dr J R Stockton

unread,
Nov 11, 2017, 6:40:03 PM11/11/17
to
On Friday, November 10, 2017 at 11:08:57 AM UTC, Todd Vargo wrote:
> On 11/2/2017 9:28 AM, JRS wrote:
> > On Thursday, 2 November 2017 08:50:57 UTC, Todd Vargo wrote:
> >> On 11/1/2017 7:00 PM, JRS wrote:
> >
> >
> >>> So I want a batch file ...
> > ^^^^^^^^^^
> ^^^^^^^^^^^^^^^^^^^^^^^
>
> So what have you written so far applicable to your query.
>
> Any effort at all? Doubtful.


You should be able to work it out, near enough, from the penultimate paragraph of my previous article here. In fact, I wrote

echo To compress NEMO, Win 7, right click it, Send To ...

which, after initial processing by CMD.EXE, will then come to the attention of a higher level interpreter.

Please note : "want" != "need".

--
(c) John Stockton, near London, UK. Using Google, no spell-check. |
Mail: J.R.""""""""@physics.org - or as Reply-To |

Todd Vargo

unread,
Nov 12, 2017, 10:41:49 PM11/12/17
to
On 11/11/2017 6:40 PM, Dr J R Stockton wrote:
> On Friday, November 10, 2017 at 11:08:57 AM UTC, Todd Vargo wrote:
>> On 11/2/2017 9:28 AM, JRS wrote:
>>> On Thursday, 2 November 2017 08:50:57 UTC, Todd Vargo wrote:
>>>> On 11/1/2017 7:00 PM, JRS wrote:
>>>
>>>
>>>>> So I want a batch file ...
>>> ^^^^^^^^^^
>> ^^^^^^^^^^^^^^^^^^^^^^^
>>
>> So what have you written so far applicable to your query.
>>
>> Any effort at all? Doubtful.
>
>
> You should be able to work it out, near enough, from the penultimate paragraph of my previous article here. In fact, I wrote
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Thanks for the offer but NO.


>
> echo To compress NEMO, Win 7, right click it, Send To ...
>
> which, after initial processing by CMD.EXE, will then come to the attention of a higher level interpreter.
>
> Please note : "want" != "need".
>

So, pseudo code = "effort" = "solved". Congrats.
0 new messages