happydog234
asked on
Problems using zip
I'm trying to zip a directory into a zip file (and all sub dirs and files in the that dir)
I can get it to zip fine, but it stores the directory structure BEFORE the root location of the zip.
Example:
zip myfile.zip E:\www\mydir\ziphere
It zips from the E:, not from the ziphere, so when I extract the file I get the root folders... www then mydir then finally ziphere... that doens't work for my needs (moving zip file one machin to the next) how do I suporess the storing of this early dir structure *but maintain the strucutre beyond my root)?
thanks
I can get it to zip fine, but it stores the directory structure BEFORE the root location of the zip.
Example:
zip myfile.zip E:\www\mydir\ziphere
It zips from the E:, not from the ziphere, so when I extract the file I get the root folders... www then mydir then finally ziphere... that doens't work for my needs (moving zip file one machin to the next) how do I suporess the storing of this early dir structure *but maintain the strucutre beyond my root)?
thanks
I have not used zip in a while, so I first have to check if there is a command line option to allow this. One option that will definitely work is to first cd to the "ziphere" directory and use something like this:
cd E:\www\mydir\ziphere
zip myfile.zip .
Or, if you want ziphere to be the first element:
cd e:\www\mydir
zip myfile.zip ziphere
cd E:\www\mydir\ziphere
zip myfile.zip .
Or, if you want ziphere to be the first element:
cd e:\www\mydir
zip myfile.zip ziphere
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many thanks- it worked!
[Hangs head in shame]. I can't believe I didn't think of changing the directory...
[Hangs head in shame]. I can't believe I didn't think of changing the directory...
ASKER