Question Token Ibragimov · Feb 11, 2019

How to unpack rar archive

Hello,

How I can unpack rar archive with 7z program in COS?

Comments

Token Ibragimov  Mar 27, 2019 to Robert Cemper

Hello!

Trying to unrar archive in terminal , but the process is blocked.   

Cache run in Windows server 2012

Code bellow

        Set cmdLine="""C:\Program Files (x86)\WinRAR\Rar.exe"" x "_path_" *.dbf "_pathToExt
        Set errCode=$ZF(-100,cmdLine)

Why the command is not executed?

0
Eduard Lebedyuk  Mar 27, 2019 to Token Ibragimov

$zf(-100) has different signature:

set cmd = """C:\Program Files (x86)\WinRAR\Rar.exe"""
set args(1) = "x"
set args(2) = path _ "*.dbf"
set args(3) = pathToExt
set sc = $ZF(-100,"/SHELL", cmd,.args)
0
Token Ibragimov  Mar 27, 2019 to Eduard Lebedyuk

 Hello, Eduard! Thanks for the answer!

I change to $ZF(-1) and it works

Set cmdLine="""C:\Program Files (x86)\WinRAR\Rar.exe"" x "_"C:\billing\gor.rar "_"*.dbf"_" C:\billing\"
 Set errCode=$ZF(-1,cmdLine)

0
Nirshanthini Kugappiriyan  Nov 16, 2021 to Eduard Lebedyuk

I'm trying to unzip a CSV file and save it to a different folder. I utilised above example but unfortunately below command is returning the status code 1. 

set path = "U:\xxx\xxxxx.zip"
set pathtoExt = "U:\uncompress\"
set cmd = """C:\Program Files\7-Zip\7zG.exe"""
set args = 3
set args(1) = "x"
set args(2) = path_ "*.csv"
set args(3) = pathtoExt
set status = $ZF(-100,"/SHELL",cmd,.args)
write status

0
Ralf Looschen  Nov 17, 2021 to Nirshanthini Kugappiriyan

The following example returns status code 0 to me:

set path = "U:\TEST.rar"
set pathtoExt = "U:\uncompress\"
set cmd = """C:\Program Files\7-Zip\7z.exe"""
set args = 4
set args(1) = "x"
set args(2) = path
set args(3) = "-o"_pathtoExt
set args(4) = "-aoa"  ; set Overwrite mode = always
set status = $ZF(-100,"/SHELL",cmd,.args)
write status
0