Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7992721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:38:57+00:00 2026-06-04T13:38:57+00:00

I am using 7z command line executable to zip files, but I see that

  • 0

I am using 7z command line executable to zip files, but I see that while adding to an archive the path of the files is preserved in the archive.

So if I do

7z a -tzip  myzip.zip dir1\dir2\*

the archive myzip.zip will contain the path dir1\dir2. I do not want this, rather I want only the files to be added to the zip file without the paths being preserved.
I searched quite a bit but do not seem to find any way of doing this, maybe I am missing something obvious?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:38:59+00:00Added an answer on June 4, 2026 at 1:38 pm

    Give the full path. That should work. Not the relative path from the current location.
    For example, I give the below, where I want the files in the man5 folder to be archived.

    $ 7z a -tzip myzip.zip /home/pradeeban/Desktop/man4/man5/*
    

    The zip contained only the files, without the directories.

    Then I gave only the relative path. It had the directories, inside the zip.

    $ 7z a -tzip myzip.zip Desktop/man4/man5/*
    

    Tried with Linux (Ubuntu 12.04). Not sure whether that differs from Windows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am able to call the following exe using windows command line, but using
I have a makefile project that builds and links a DLL, using the command-line
On Linux, I'm using supbprocess.Popen to run an app. The command line of that
I have a command line executable that is run from a C# class library.
Using the command line how can I get a listing of all files in
It appears that I can escape command line arguments using single or double quotes:
I am developing a set of command line utilities that are very small using
I simply want to run an executable from the command line, ./arm-mingw32ce-g++ , but
I am writing a command line executable that performs XML operations. I want the
If you are writing a program that is executable from the command line, you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.