Running 7zip Commands

Started by keslaa, November 21, 2017, 05:46:24 AM

Previous topic - Next topic

keslaa

I am trying to extract a great number of .ZIP files using 7z.exe. I have set the actual command to be:

runwait(environment("COMSPEC"), "/c C:\Program Files (x86)\7-Zip\7z.exe e %filename%"

The line works within a command window; meaning: I can open CMD, change directories to the location of %filename% and run "C:\Program Files (x86)\7-Zip\7z.exe e %filename%" successfully. However, when I run it within the script, the .ZIP file is not extracted. I see the command window open and close quickly, but can't read what is in the window. What is the easiest way I can pipe or capture the output of the window to see what the error is?

keslaa

Oops. "/k" instead of "/c". Got it now. Never mind

td

You might want to consider quoting the zip7 path; otherwise, the command shell with try to run something called "Program".

Code (winbatch) Select
runwait(environment("COMSPEC"), '/K "C:\Program Files (x86)\7-Zip\7z.exe" e ':filename)
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade