>>>Hi
>>>
>>>I've been down this road before but have lost my code and need a solution in a hurry
>>>
>>>Anyone have a really simple prg for zipping up a directory?
>>>
>>>Thanks
>>>
>>>Colin
>>
>>Check Zipping files from inside VFP Thread #
1222560>
>Naomi - I simplified the code as follows and it works a treat
>
>lcDataPath='o:\swedvfp\vfp\'
>lcZipFileName="o:\zips\colin.zip"
>strtofile(chr(0x50)+chr(0x4B)+chr(0x05)+chr(0x06)+replicate(chr(0),18),lcZipFileName)
>oShell=CREATEOBJECT("shell.application")
>FOR EACH ofile IN oShell.NameSpace(lcDataPath).items
> WAIT WINDOW "Archiving File: " + oFile.Name + ' to ' + lcZipFileName NOWAIT
> oShell.NameSpace(lcZipFileName).copyhere(ofile)
>ENDFOR
>WAIT clear
>
>Thanks as always
You're welcome. If you have a chance, test it on Windows Vista and Windows 7 - it may not work as is. Also there were some concerns raised in one of the older threads of the legality of this code - nothing definite, though.
Let me know if you want to look up these threads just in case.
If it's not broken, fix it until it is.
My Blog