Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3FEED18D6C for ; Mon, 4 Jan 2016 17:19:40 +0000 (UTC) Received: (qmail 52190 invoked by uid 500); 4 Jan 2016 17:19:40 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 52098 invoked by uid 500); 4 Jan 2016 17:19:40 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 52074 invoked by uid 99); 4 Jan 2016 17:19:39 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jan 2016 17:19:39 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D1D0A2C1F56 for ; Mon, 4 Jan 2016 17:19:39 +0000 (UTC) Date: Mon, 4 Jan 2016 17:19:39 +0000 (UTC) From: "Siegfried Goeschl (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (EXEC-95) Program not found after setWorkingDirectory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/EXEC-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15081398#comment-15081398 ] Siegfried Goeschl commented on EXEC-95: --------------------------------------- Mhmm, it looks that way :-( Since the original code of this class comes from Apache Ant I'm checking the current implementation > Program 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 > Assignee: Siegfried Goeschl > > 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)