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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:49:52+00:00 2026-05-25T11:49:52+00:00

I want to be able to remote into a system and zip or unzip

  • 0

I want to be able to remote into a system and zip or unzip files there and have the process signal when it is complete. Start-process works with the -wait parameter to run 7z.exe synchronously from PowerShell. When I try to combine that with invoke-command to run the same command remotely, it does not honor the wait parameter and I believe it is killing the process since it returns quickly and never produces a zip file.

[string]$sevenZip = "C:\Program Files\7-zip\7z.exe"
[Array]$arguments = "a", $zipFilename, $dirToZip;

"Starting $sevenZip with $arguments"
Start-Process $sevenZip "$arguments" -Wait
#blocks and waits for zip file to complete

I originally tried the PSCX write-zip & expand-archive, but the latter is not compatible with 64-bit .NET 4.0 configuration. So now I’m trying to call 64-bit 7z.exe through the command line. I’m not receiving any errors. PowerShell reports the job as running state and then complete, and no zip file is produced.

Invoke-Command -ComputerName localhost -FilePath 'C:\Scripts\ZipIt.ps1' -ArgumentList    'd:\TestFolder','d:\promote\TestFile.7z' -AsJob

Appreciate any help or pointers.

Thanks,
Gregory

  • 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-05-25T11:49:53+00:00Added an answer on May 25, 2026 at 11:49 am

    Since Start-Process will be used synchronously here, I would recommend avoiding it and just use the 7z.exe executable:

    $sevenZip = "C:\Program Files\7-zip\7z.exe"
    &$sevenZip a $zipFileName $dirToZip
    

    Doing so will naturally block your script until 7zip completes its job.

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

Sidebar

Related Questions

I want to be able to retrieve a remote image from a webserver, resample
I want to be able to enter a URL into a form, without clicking
I want to put some compressed data into a remote repository. To put data
I have an XML file that is loaded into an XElement. I want to
I have a flash file where I load a remote SWF file into my
Okay, I have a question guys. I want to remote upload (copy an image
I just want to be able to connect to a remote MySQL database on
I want to use Fabric.api.run to directly start an application in a remote box.
I have a localhost Apache/PHP configuration on my computer. I want to be able
So I want to be able to add/remove class methods at runtime. Before 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.