Log in or sign up to continue

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?

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

 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)

.

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

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

Perfect. Thanks Ralf. it worked.