Page 1 of 1

7-Zip arguments for Unzipping a zip file using Execute Command

Posted: Mon May 11, 2020 2:08 pm
by macphenom
Hi

I I have been playing with 7-Zip for unzipping large zip files that Switch has been erroring on. Its an issue with the structure
of the zip file. I can unzip it using 7-Zip from a command line but I can't seem to get the arguments correct in Switch to execute it within the Switch workflow. Does anyone have the arguments that they could forward me that work?

Thank-You

Lance

Re: 7-Zip arguments for Unzipping a zip file using Execute Command

Posted: Mon May 11, 2020 3:37 pm
by Malcolm Mackenzie

Re: 7-Zip arguments for Unzipping a zip file using Execute Command

Posted: Mon May 11, 2020 3:43 pm
by macphenom
Malcolm Mackenzie wrote: Mon May 11, 2020 3:37 pm See this thread
viewtopic.php?f=25&t=3719
I had seen that earlier but its not exactly what i'm looking for. All I need is the structure of the unzip commands.
I have tried "%1" e "%2" which should be working but its not. Not sure what i'm missing. Are there other flags
that need to be added or does the "e" flag need to be put in another location?

Thanks

Re: 7-Zip arguments for Unzipping a zip file using Execute Command

Posted: Mon May 11, 2020 4:01 pm
by jan_suhr
Execute command is tricky.

In some cases it works without the quotes and in some with them.

The Output options in the properties are important too. You could also try %3 to output to folder.

Re: 7-Zip arguments for Unzipping a zip file using Execute Command

Posted: Mon May 11, 2020 4:08 pm
by macphenom
jan_suhr wrote: Mon May 11, 2020 4:01 pm Execute command is tricky.

In some cases it works without the quotes and in some with them.

The Output options in the properties are important too. You could also try %3 to output to folder.
Unfortunately I have tried those options and its still a no go. I was hoping someone out there uses 7-Zip in a command environment to unzip and is successful and I could copy their work;)

Re: 7-Zip arguments for Unzipping a zip file using Execute Command

Posted: Mon May 11, 2020 4:27 pm
by billy.olvestad
macphenom wrote: Mon May 11, 2020 4:08 pm Execute command is tricky.

In some cases it works without the quotes and in some with them.

The Output options in the properties are important too. You could also try %3 to output to folder.

Unfortunately I have tried those options and its still a no go. I was hoping someone out there uses 7-Zip in a command environment to unzip and is successful and I could copy their work;)
I have wrestled 7-zip too, and managed to make it work with the following settings:

Command or path: C:/Program Files/7-Zip/7z.exe (Obviously, the path can be different for you. Check on your system)
Command or path: Single-line text with variables defined
The variables are:
x "%1" "-o<Path to output folder>/[Job.NameProper]" * -r
x here means extract %1 within quotation marks is the input folder path, -o means output path, and then you have the path itself (directly after -o, with no space), and in my case i chose the "NameProper" as the folder name of the extracted folder. Everything within quotation marks, and then * for all files and folders, and -r for recursive
Output: Folder at path
Copy input job: No

These are the only settings that worked for me. Note that I set the input folder and output folder as fixed folders instead of auto managed.

Re: 7-Zip arguments for Unzipping a zip file using Execute Command

Posted: Mon May 11, 2020 4:41 pm
by macphenom
billy.olvestad wrote: Mon May 11, 2020 4:27 pm
macphenom wrote: Mon May 11, 2020 4:08 pm Execute command is tricky.

In some cases it works without the quotes and in some with them.

The Output options in the properties are important too. You could also try %3 to output to folder.

Unfortunately I have tried those options and its still a no go. I was hoping someone out there uses 7-Zip in a command environment to unzip and is successful and I could copy their work;)
I have wrestled 7-zip too, and managed to make it work with the following settings:

Command or path: C:/Program Files/7-Zip/7z.exe (Obviously, the path can be different for you. Check on your system)
Command or path: Single-line text with variables defined
The variables are:
x "%1" "-o<Path to output folder>/[Job.NameProper]" * -r
x here means extract %1 within quotation marks is the input folder path, -o means output path, and then you have the path itself (directly after -o, with no space), and in my case i chose the "NameProper" as the folder name of the extracted folder. Everything within quotation marks, and then * for all files and folders, and -r for recursive
Output: Folder at path
Copy input job: No

These are the only settings that worked for me. Note that I set the input folder and output folder as fixed folders instead of auto managed.
Its unfortunate it can't negotiate through the auto managed folders. Thank you for your input.

Re: 7-Zip arguments for Unzipping a zip file using Execute Command

Posted: Mon May 11, 2020 4:51 pm
by billy.olvestad
macphenom wrote: Mon May 11, 2020 4:41 pm Its unfortunate it can't negotiate through the auto managed folders. Thank you for your input.
What do you mean?
Are you required to use auto managed folders?

Re: 7-Zip arguments for Unzipping a zip file using Execute Command

Posted: Mon May 11, 2020 4:52 pm
by jan_suhr
Some command line applications have problems with spaces in folder names. And the path to the automanged folders have spaces in there. That 's why Billy's approach works. I guess you have folder paths without spaces in there.

You could usually see if there is a path problem caused by spaces, the Debug messages will show that when your Execute command.

Re: 7-Zip arguments for Unzipping a zip file using Execute Command

Posted: Mon May 11, 2020 4:57 pm
by macphenom
billy.olvestad wrote: Mon May 11, 2020 4:51 pm
macphenom wrote: Mon May 11, 2020 4:41 pm Its unfortunate it can't negotiate through the auto managed folders. Thank you for your input.
What do you mean?
Are you required to use auto managed folders?
No, I don't need auto managed folders. Its just using them makes it easier to document flows to hand over to my replacement when I retire in a few months.

Thanks again for the input. Its appreciated.