Comment 2 for bug 1813494

Revision history for this message
spikedboy (spikedboy) wrote : Re: [1.1.4] Windows: Working dir not set

When you do:

App app = new App("C:\\Path\\to\\runnable.exe");
app.open();

This triggers a cmd execution to Windows, like:

cmd /C start "" /B "C:\Path\to\runnable.exe"

Problem is this cmd command seems to be run inside a default directory or inheriting java's user dir, not sure exactly. As in, the current working dir for the commandline. Which one would change with the cd command.

Nevertheless what I would expect is the command to be run inside of the folder where the executable is or optionally specify where the current dir should be for the command.

One could do this using the processBuilder.directory(File file) method, as I see you are using the ProcessBuilder class in the org.sikuli.util.ProcessRunner class.

It is important because some processes use relative paths to their working directory. I've encountered some that just plain refuse to run without the current working directory being set in a particular way.

I hope my explanation is helpful.

Cheers!