Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Zipping a directory
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01424198
Message ID:
01424219
Views:
51
>>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform