G

Guest

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

Hello All,

I need to create a compressed folder and add some files to it in
order to ease the file transfer characteristic of my app; the OS is Windows
XP. Can I use WSH to accomplish this? if so what is the method?

I appreciate any help.

TIA
Carlos Jones
 
G

Guest

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

CreateBlankZip.vbs FileName.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 SrcFldr DestFldr
eg, unzip "C:\..\My Documents" "C:\MyZip.zip"
It doesn't matter if the source is a zip and dest is a folder EXCEPT it only works zipping if there is a msgbox as the last statement. Dunno why. Msgbox is not needed if unzipping. I think it's an object reference thing and zipping is slow. Both Folders/Zips must exist.
===================================
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
=================================================
"Carlos Jones" <carlosj@farmaciasdesimilares.com.mx> wrote in message news:uhRcZ26jFHA.576@TK2MSFTNGP15.phx.gbl...
> Hello All,
>
> I need to create a compressed folder and add some files to it in
> order to ease the file transfer characteristic of my app; the OS is Windows
> XP. Can I use WSH to accomplish this? if so what is the method?
>
> I appreciate any help.
>
> TIA
> Carlos Jones
>
>