You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Lorenzo Cozza (JIRA)" <ji...@apache.org> on 2015/10/16 18:42:07 UTC

[jira] [Created] (EXEC-95) programm not find after setWorkingDirectory

Lorenzo Cozza created EXEC-95:
---------------------------------

             Summary: programm not find after setWorkingDirectory
                 Key: EXEC-95
                 URL: https://issues.apache.org/jira/browse/EXEC-95
             Project: Commons Exec
          Issue Type: Bug
    Affects Versions: 1.3
         Environment: win7 64 bit.
            Reporter: Lorenzo Cozza


I would like to run my script from a different folder, so I tried to use the following line of code:

String path = "C:/user/script/";
CommandLine cmdLine = CommandLine.parse("myscript.cmd");
DefaultExecutor executor = new DefaultExecutor();
executor.setWorkingDirectory(new File(path));
int exitValue = executor.execute(cmdLine);

but I got an exception.
I am using the following workaround:
CommandLine cmdLine = CommandLine.parse(path+"/myscript.cmd");
and it's working fine.

The question is: are Executor and CommandLine related?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)