Exec windows command / grab output

I run an DB environment called OpenInsight, which is a 4GL language /

The environment is closed, other than we can now access the database
via the web using CGI.
This is the command which is executed from a browser :


and it works perfectly.
I have tried to replicate this in ruby - and cannot.

I’ve tried exec, but that kills all sessions as it appears to fork and
then exit

I’ve tried system(‘dir’) to attempt to trial how this might work, but
cannot capture the output.
And, I’ve had better luck with system - other than it returns true /
false - not the results.

How can I setup and create a RUBY environment so that I can exec the
OECGI2.exe from a browser / passing it params - the /inet_Trace is the
name of a function that the DB executes, and this does work in all
Apache is used as the web server.