Syntax question about OS-COMMAND

Posted by mongo on 26-Aug-2015 17:45

Hi can anyone help me with OS-COMMAND? I am trying to write ABL code to run a windows .exe file and pass it three parameters, two of the parameters contain a variable. So I have been building up a CHAR variable and running;

DEF VAR cParams AS CHAR NO-UNDO.

cParams = "\\SERVER1\FOLDER\PROGRAMS\DocBuild.exe \\SERVER1\FOLDER\INPUT\TEMP.docx \\SERVER1\FOLDER\INPUT\" + cInputFile1 + ".xml" + " \\SERVER1\FOLDER\OUTPUT\" + cInputFile1 + ".docx".

OS-COMMAND VALUE(cParams).

But it refuses to run. I don't get any error message and I get no output.

I have seen references to createprocessA but that seems to be VB based. What am I doing wrong?

All Replies

Posted by TheMadDBA on 26-Aug-2015 18:14

Does cInputFile1 contain spaces or other special characters? Can you show the entire command?

A few KBs that may or may not be related to your problem...

knowledgebase.progress.com/.../P192217

knowledgebase.progress.com/.../000034773

Posted by George Potemkin on 26-Aug-2015 23:42

Try: OS-COMMAND VALUE("echo " + cParams).

Posted by Frank Meulblok on 27-Aug-2015 03:31

Or try to run the command line directly from a Windows command prompt, outside of OpenEdge.

If that fails as well, there's something wrong with the command line itself.

(I assume you know a valid value for the cInputFile1 variable to test with).

Posted by mongo on 27-Aug-2015 09:43

Hi Frank,


Of course I thought I had run the command from a windows prompt but I tried again anyway (from the default directory where cmd landed rather than the directory where the program resided). Finally, an error message! I did not have the correct version of .net framework on my development machine. Download and install .net 4.5.2 and bingo! It works perfectly! Thanks for your help.

Regards Mark
On 27 Aug 2015, at 09:32, Frank Meulblok <bounce-fmeulblo@community.progress.com> wrote:

Reply by Frank Meulblok

Or try to run the command line directly from a Windows command prompt, outside of OpenEdge.

If that fails as well, there's something wrong with the command line itself.

(I assume you know a valid value for the cInputFile1 variable to test with).

Stop receiving emails on this subject.

Flag this post as spam/abuse.


Posted by mongo on 27-Aug-2015 09:44

Hi George,


I tried this but no difference….
It was the version of .net on the machine that needed upgrading.
On 27 Aug 2015, at 05:43, George Potemkin <bounce-GeorgeP12@community.progress.com> wrote:

Reply by George Potemkin

Try: OS-COMMAND VALUE("echo " + cParams).

Stop receiving emails on this subject.

Flag this post as spam/abuse.


Posted by mongo on 27-Aug-2015 09:46

Thanks MadDBA,


I tried all of the suggestions but it looked like to no avail. In fact once I had sorted the .net version out I’m sure the regedt32 command helped me too because I can run it with URL addresses no problem.


On 27 Aug 2015, at 00:15, TheMadDBA <bounce-TheMadDBA@community.progress.com> wrote:

Reply by TheMadDBA

Does cInputFile1 contain spaces or other special characters? Can you show the entire command?

A few KBs that may or may not be related to your problem...

knowledgebase.progress.com/.../P192217

knowledgebase.progress.com/.../000034773

Stop receiving emails on this subject.

Flag this post as spam/abuse.


Posted by George Potemkin on 27-Aug-2015 09:54

The idea with "echo " is to see an exact string your program passes to OS. Did you see a console screen? Is it what you expect to pass to OS?

This thread is closed