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

Post Reply
macphenom
Newbie
Posts: 5
Joined: Fri May 08, 2020 6:25 pm

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

Post by macphenom » Mon May 11, 2020 2:08 pm

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

Malcolm Mackenzie
Member
Posts: 87
Joined: Wed Mar 22, 2017 5:05 pm
Location: London, UK
Contact:

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

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


macphenom
Newbie
Posts: 5
Joined: Fri May 08, 2020 6:25 pm

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

Post by macphenom » Mon May 11, 2020 3:43 pm

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

jan_suhr
Advanced member
Posts: 320
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

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

Post by jan_suhr » 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.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps

macphenom
Newbie
Posts: 5
Joined: Fri May 08, 2020 6:25 pm

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

Post by macphenom » Mon May 11, 2020 4:08 pm

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;)

User avatar
billy.olvestad
Member
Posts: 32
Joined: Mon Nov 19, 2018 10:08 pm
Location: Sweden
Contact:

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

Post by billy.olvestad » 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.

macphenom
Newbie
Posts: 5
Joined: Fri May 08, 2020 6:25 pm

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

Post by macphenom » Mon May 11, 2020 4:41 pm

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.

User avatar
billy.olvestad
Member
Posts: 32
Joined: Mon Nov 19, 2018 10:08 pm
Location: Sweden
Contact:

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

Post by billy.olvestad » 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?

jan_suhr
Advanced member
Posts: 320
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

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

Post by jan_suhr » Mon May 11, 2020 4:52 pm

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.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps

macphenom
Newbie
Posts: 5
Joined: Fri May 08, 2020 6:25 pm

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

Post by macphenom » Mon May 11, 2020 4:57 pm

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.

Post Reply