application.executeProgram throws an exception

I would like to use application.executeProgram to run an application. The application’s bin location is already placed in the “Path” of System variables so as not to include it in the parameter. I am calling it as follows:

application.executeProgram(“application.exe”);

This is working in the developer mode but not when deployed in the apache server. Any input regarding this is highly appreciated. Thanks.

smart or webclient?

for a smart client that should work if on the smart clients pc it can find that application.exe
for a webclient this will not work because that will be executed on the server not on the client (browser) itself.

I am using a smart client. The code works when I run the solution through the Servoy developer.

But when I deploy the solution in the server, the code does not see the path and cannot run the application.

what if you really place that application.exe somewhere on that smart client and you use a hard path to it?

jcompagner:
what if you really place that application.exe somewhere on that smart client and you use a hard path to it?

When I place the full path of the application, it works well. But what I would like to do is to allow the user to set the path of the application.exe from the “Path” system variables. When I do this a dialog box displaying “Program execution failed.” is displayed.

It seems that application.executeProgram only works if the full path is included as the parameter. It does not act like a windows command prompt which looks for corresponding file in “Path” system environment variable.

We call Runtime.exec() on it. And that is really executed a program, that is not the same as a windows command prompt i think.

what you could try is this:

“cmd /c application.exe”

jcompagner:
We call Runtime.exec() on it. And that is really executed a program, that is not the same as a windows command prompt i think.

what you could try is this:

“cmd /c application.exe”

Thanks for this.