steve

Distinguished
Sep 10, 2003
2,366
0
19,780
Archived from groups: microsoft.public.windowsxp.general (More info?)

Good day.

Is it possible to write a batch file or is there some VBA code that anyone
knows to zip or compress a file using the XP compression?

Thanks,
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.general (More info?)

CreateBlankZip.vbs
CreateBlankZip ZipfileName.zip
-----------------------------------------
Set Ag=Wscript.Arguments
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso_OpenTextFile(Ag(0), 8, vbtrue)
BlankZip = "PK" & Chr(5) & Chr(6)
For x = 0 to 17
BlankZip = BlankZip & Chr(0)
Next
ts.Write BlankZip

Unzip.vbs
Unzip can zip as well. Zips are folders for this purpose.
The messagebox statement is needed if destination is a zip (don't ask cos I dunno but it won't zip but will unzip if the message box statement doesn't exist). Folders MUST exist. Must quote parameters if they contain a space.
Unzip SourceFolder DestinationFolder.zip
-----------------------------------------------------------------------
Set objShell = CreateObject("Shell.Application")
Set Ag=Wscript.Arguments
set WshShell = WScript.CreateObject("WScript.Shell")
Set DestFldr=objShell.NameSpace(Ag(1))
Set SrcFldr=objShell.NameSpace(Ag(0))
Set FldrItems=SrcFldr.Items
DestFldr.CopyHere FldrItems, &H214
Msgbox "Finished"


--
--------------------------------------------------------------------------------------------------
http://webdiary.smh.com.au/archives/_comment/001075.html
=================================================
"Steve" <Steve@discussions.microsoft.com> wrote in message news:F97393AA-7554-4BA0-AC65-9A7F7B568786@microsoft.com...
> Good day.
>
> Is it possible to write a batch file or is there some VBA code that anyone
> knows to zip or compress a file using the XP compression?
>
> Thanks,
>
 

steve

Distinguished
Sep 10, 2003
2,366
0
19,780
Archived from groups: microsoft.public.windowsxp.general (More info?)

Thanks for the information. Can you give me a bit more guidance as to how
and where I would use this code? Is this a batch or VBA or how do I
implement this?

Thanks again.

"David Candy" wrote:

> CreateBlankZip.vbs
> CreateBlankZip ZipfileName.zip
> -----------------------------------------
> Set Ag=Wscript.Arguments
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set ts = fso_OpenTextFile(Ag(0), 8, vbtrue)
> BlankZip = "PK" & Chr(5) & Chr(6)
> For x = 0 to 17
> BlankZip = BlankZip & Chr(0)
> Next
> ts.Write BlankZip
>
> Unzip.vbs
> Unzip can zip as well. Zips are folders for this purpose.
> The messagebox statement is needed if destination is a zip (don't ask cos I dunno but it won't zip but will unzip if the message box statement doesn't exist). Folders MUST exist. Must quote parameters if they contain a space.
> Unzip SourceFolder DestinationFolder.zip
> -----------------------------------------------------------------------
> Set objShell = CreateObject("Shell.Application")
> Set Ag=Wscript.Arguments
> set WshShell = WScript.CreateObject("WScript.Shell")
> Set DestFldr=objShell.NameSpace(Ag(1))
> Set SrcFldr=objShell.NameSpace(Ag(0))
> Set FldrItems=SrcFldr.Items
> DestFldr.CopyHere FldrItems, &H214
> Msgbox "Finished"
>
>
> --
> --------------------------------------------------------------------------------------------------
> http://webdiary.smh.com.au/archives/_comment/001075.html
> =================================================
> "Steve" <Steve@discussions.microsoft.com> wrote in message news:F97393AA-7554-4BA0-AC65-9A7F7B568786@microsoft.com...
> > Good day.
> >
> > Is it possible to write a batch file or is there some VBA code that anyone
> > knows to zip or compress a file using the XP compression?
> >
> > Thanks,
> >
>
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.general (More info?)

It's vbs but will be substantially similar, maybe identical, code in VBA (that is Visual Basic in Microsoft Office's Programs). The two files are meant to be used by people as samples to make their own vbs scripts and for the desperate as commands in a batch file (I added cmd line parameters - it used to require hand editing the names in the file).

--
--------------------------------------------------------------------------------------------------
http://webdiary.smh.com.au/archives/_comment/001075.html
=================================================
"Steve" <Steve@discussions.microsoft.com> wrote in message news:F442CCF2-C280-4D10-8A40-415A3BFA644D@microsoft.com...
> Thanks for the information. Can you give me a bit more guidance as to how
> and where I would use this code? Is this a batch or VBA or how do I
> implement this?
>
> Thanks again.
>
> "David Candy" wrote:
>
>> CreateBlankZip.vbs
>> CreateBlankZip ZipfileName.zip
>> -----------------------------------------
>> Set Ag=Wscript.Arguments
>> Set fso = CreateObject("Scripting.FileSystemObject")
>> Set ts = fso_OpenTextFile(Ag(0), 8, vbtrue)
>> BlankZip = "PK" & Chr(5) & Chr(6)
>> For x = 0 to 17
>> BlankZip = BlankZip & Chr(0)
>> Next
>> ts.Write BlankZip
>>
>> Unzip.vbs
>> Unzip can zip as well. Zips are folders for this purpose.
>> The messagebox statement is needed if destination is a zip (don't ask cos I dunno but it won't zip but will unzip if the message box statement doesn't exist). Folders MUST exist. Must quote parameters if they contain a space.
>> Unzip SourceFolder DestinationFolder.zip
>> -----------------------------------------------------------------------
>> Set objShell = CreateObject("Shell.Application")
>> Set Ag=Wscript.Arguments
>> set WshShell = WScript.CreateObject("WScript.Shell")
>> Set DestFldr=objShell.NameSpace(Ag(1))
>> Set SrcFldr=objShell.NameSpace(Ag(0))
>> Set FldrItems=SrcFldr.Items
>> DestFldr.CopyHere FldrItems, &H214
>> Msgbox "Finished"
>>
>>
>> --
>> --------------------------------------------------------------------------------------------------
>> http://webdiary.smh.com.au/archives/_comment/001075.html
>> =================================================
>> "Steve" <Steve@discussions.microsoft.com> wrote in message news:F97393AA-7554-4BA0-AC65-9A7F7B568786@microsoft.com...
>> > Good day.
>> >
>> > Is it possible to write a batch file or is there some VBA code that anyone
>> > knows to zip or compress a file using the XP compression?
>> >
>> > Thanks,
>> >
>>
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.general (More info?)

As a batch

CreateBlankZip c:\myzip.zip
Unzip c:\AFolder c:\myzip.zip

It does whole folders as written.

--
--------------------------------------------------------------------------------------------------
http://webdiary.smh.com.au/archives/_comment/001075.html
=================================================
"Steve" <Steve@discussions.microsoft.com> wrote in message news:F442CCF2-C280-4D10-8A40-415A3BFA644D@microsoft.com...
> Thanks for the information. Can you give me a bit more guidance as to how
> and where I would use this code? Is this a batch or VBA or how do I
> implement this?
>
> Thanks again.
>
> "David Candy" wrote:
>
>> CreateBlankZip.vbs
>> CreateBlankZip ZipfileName.zip
>> -----------------------------------------
>> Set Ag=Wscript.Arguments
>> Set fso = CreateObject("Scripting.FileSystemObject")
>> Set ts = fso_OpenTextFile(Ag(0), 8, vbtrue)
>> BlankZip = "PK" & Chr(5) & Chr(6)
>> For x = 0 to 17
>> BlankZip = BlankZip & Chr(0)
>> Next
>> ts.Write BlankZip
>>
>> Unzip.vbs
>> Unzip can zip as well. Zips are folders for this purpose.
>> The messagebox statement is needed if destination is a zip (don't ask cos I dunno but it won't zip but will unzip if the message box statement doesn't exist). Folders MUST exist. Must quote parameters if they contain a space.
>> Unzip SourceFolder DestinationFolder.zip
>> -----------------------------------------------------------------------
>> Set objShell = CreateObject("Shell.Application")
>> Set Ag=Wscript.Arguments
>> set WshShell = WScript.CreateObject("WScript.Shell")
>> Set DestFldr=objShell.NameSpace(Ag(1))
>> Set SrcFldr=objShell.NameSpace(Ag(0))
>> Set FldrItems=SrcFldr.Items
>> DestFldr.CopyHere FldrItems, &H214
>> Msgbox "Finished"
>>
>>
>> --
>> --------------------------------------------------------------------------------------------------
>> http://webdiary.smh.com.au/archives/_comment/001075.html
>> =================================================
>> "Steve" <Steve@discussions.microsoft.com> wrote in message news:F97393AA-7554-4BA0-AC65-9A7F7B568786@microsoft.com...
>> > Good day.
>> >
>> > Is it possible to write a batch file or is there some VBA code that anyone
>> > knows to zip or compress a file using the XP compression?
>> >
>> > Thanks,
>> >
>>