commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksandr Dubinsky (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (EXEC-95) programm not found after setWorkingDirectory
Date Sat, 24 Oct 2015 13:47:27 GMT

    [ https://issues.apache.org/jira/browse/EXEC-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14972572#comment-14972572
] 

Aleksandr Dubinsky edited comment on EXEC-95 at 10/24/15 1:47 PM:
------------------------------------------------------------------

It looks like `WinNTCommandLauncher` doesn't do the one thing it is supposed to.

Line 64 `return exec(newCmd, env);` should be `return super.exec(newCmd, env, workingDir);`


was (Author: almson):
It looks like `WinNTCommandLauncher` doesn't do the one thing it is supposed to.

Line 64 `return exec(newCmd, env);` should be `return exec(newCmd, env, workingDir);`

> programm not found 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)

Mime
View raw message