Word :    Username :           
 

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,

Sponsored Links
Register or log in to remove.

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/archive [...] 01075.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,
>

Reply to Anonymous
- 0 +

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/archive [...] 01075.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,
> >
>

Reply to steve

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/archive [...] 01075.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/archive [...] 01075.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,
>> >
>>

Reply to Anonymous

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/archive [...] 01075.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/archive [...] 01075.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,
>> >
>>

Reply to Anonymous
Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > compressing file
Go to:

There are 439 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them