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 7926725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:53:57+00:00 2026-06-03T18:53:57+00:00

I have a small problem trying to unzip a file using the 7za command-line

  • 0

I have a small problem trying to unzip a file using the 7za
command-line utility in Powershell.

I set the $zip_source variable to the zip file’s path and the
$unzip_destination to the desired output folder.

However the command-line usage of 7za needs arguments specified like this:

7za x -y <zip_file> -o<output_directory>

So my current call looks like this:

& '7za' x -y "$zip_source" -o$unzip_destination

Due to the fact that there can be no space between -o and the destination it
seems that PowerShell will not expand the $unzip_destination variable, whereas $zip_source is expanded.

Currently the program simply extracts all the files into the root of C:\ in
a folder named $unzip_destination.
Setting different types of quotes around the variable won’t work neither:

-o"$unzip_destination" : still extracts to C:\$unzip_destination
-o'$unzip_destination' : still extracts to C:\$unzip_destination
-o $unzip_destination  : Error: Incorrect command line

Is there any way to force an expansion before running the command?

  • 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-03T18:53:58+00:00Added an answer on June 3, 2026 at 6:53 pm

    try like this:

    -o $($unzip_destination)
    

    Editor’s note: This solution only works with a space after -o (in which case just -o $unzip_destination would do) – if you remove it, the command doesn’t work as intended.
    This approach is therefore not suitable for appending a variable value directly to an option name, as required by the OP.

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

Sidebar

Related Questions

I have small problem. I'm trying to work on an XML file, but the
I'm trying to draw a line using ctx.lineTo in loop. I have small function
I have a small math problem I am trying to solve Given a number
Im having a small problem with my code. I have been trying to read
I have a small problem. I am trying to align two divs side by
I have a small problem. I am busy trying to get messages from a
I have a small problem. Actually I'm trying to adapt the width of content
I have some small problem in understanding Value Objects in Flex... I'm trying to
I'm having a small problem with AFNetworking. Im trying to have a simple call
I have a small problem with php curl post. I am trying to post

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.