Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using 7zip for compressing a bunch of files.

The files are in a directory structure, like this:


I want to create a 7z file with the following structure via command line:


Basically, I want to zip the content of MyDir\ into a new folder called ZippedDir\. I know I could copy the content into a directory called ZippedDir\ and then zip this new directory.

However, I was wondering if there was a way to avoid this extra copy step and directly zip the content, if possible, via command line.

share|improve this question
up vote 3 down vote accepted

You do not have to copy the files, you could instead just rename MyDir\ to ZippedDir\ while compressing, and then rename back afterwords. This still require some additional preparation and cleanup work, but it will finish instantly compared to copying the files.

share|improve this answer

I don't know of anyway to do this when compressing but have you thought of just zipping up the contents of MyDir and when you extract it extract it to another directory named ZippedDir?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.