Question How Can I Execute Winrar In Openedge?

Osmar Morais

New Member
I´m trying to execute de command: "RAR a zipfile sourcefile" using the OS-COMMAND, but I´m not managing because returns error messages, maybe I´m not using the correct sintaxe. Someone could help me?
 

Keith G.

New Member
I have found in those situations that it is best to start right from the command line or with a batch file. That makes it a lot easier to keep trying it, and to see the console error messages, until you have it right. Then you can just copy-and-paste into your 4GL program's OS-COMMAND statement.

I've also found it is best to use complete paths when possible, rather than relative paths. I again recently came across something that should work just find based on the OpenEdge session's starting directory and the relative path of what was being accessed, yet something in Windows prevented it from working. Changing from a relative path to a fully qualified path fixed the problem.
 

ezequiel

Member
Hello, I'm using command-line 7zip like this:

DEF VAR cCom AS CHARACTER.
DEF VAR cZip AS CHARACTER.
DEF VAR cDir AS CHARACTER.

cZip = (your zip name with path)
cDir = (your destiny path)
cCom = 'c:\tmp\7za.exe e ' + cZip + ' -o' + cDir.

OS-COMMAND NO-CONSOLE VALUE(cCom).

It works fine.
 
Top