Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 36555 invoked from network); 18 Mar 2010 13:09:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Mar 2010 13:09:16 -0000 Received: (qmail 9818 invoked by uid 500); 18 Mar 2010 13:09:15 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 9746 invoked by uid 500); 18 Mar 2010 13:09:14 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 9738 invoked by uid 99); 18 Mar 2010 13:09:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Mar 2010 13:09:14 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of antoine@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 18 Mar 2010 13:09:06 +0000 Received: (qmail invoked by alias); 18 Mar 2010 13:08:46 -0000 Received: from user-12lcjsk.cable.mindspring.com (EHLO antoine-levy-lamberts-macbook.local) [69.86.79.148] by mail.gmx.net (mp071) with SMTP; 18 Mar 2010 14:08:46 +0100 X-Authenticated: #22961642 X-Provags-ID: V01U2FsdGVkX1/dhXo01fXdsXxb30GsWDWm4qjFFaM8mlSwg/pbAY 9MwOuBqNuYhImq Message-ID: <4BA225DD.1020005@gmx.de> Date: Thu, 18 Mar 2010 09:08:45 -0400 From: Antoine Levy Lambert User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Ant Users List Subject: Re: AW: Ant Environment References: <6B7B5E99B65A8D4CB18A8A85AEC189140469262C@radeiger.ocag.ch> <9EE86F1965E19E499C80DE52AC807B55051718FE@z011021.bk.fin.local> In-Reply-To: <9EE86F1965E19E499C80DE52AC807B55051718FE@z011021.bk.fin.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.56999999999999995 X-Virus-Checked: Checked by ClamAV on apache.org Agreed with Jan. If you want to modify permanently the environment variables of Windows machines, one of the tools you can use is VBS. I think you will find articles about which API calls to use to do this in VBS. Ant can kick off a VBS script if you do Regards, Antoine Jan.Materne@rzf.fin-nrw.de wrote: > You are right: you cannot change the values from Ant. > You could use the "setx" system command, so NEW processes will get the new values. > I dont know any possibility to change the environment for RUNNING processes. > Maybe via PowerShell, WindowsManagementInstrumentation, ... a la > for(Projess p : allRunningProcesses) > p.setEnv(key, newValue) > > > Jan > > >> -----Urspr�ngliche Nachricht----- >> Von: Maurer Philipp [mailto:philipp.maurer@rheinmetall-ad.com] >> Gesendet: Donnerstag, 18. M�rz 2010 08:18 >> An: user@ant.apache.org >> Betreff: Ant Environment >> >> Hello, >> >> >> >> I'd like to make ant modify my current shell environment on Windows >> maschines. >> >> >> Example: >> >> I'd like something like an 'ant set' (target 'set') that sets some >> 'foo=bar'. Calling that target should have the same effect >> than calling >> 'set foo=bar'. >> >> >> >> I tried some stuff: calling python scripts, generating and executing >> batch files, using setx, using cmd /C set. >> >> >> >> I think this is a more general problem and I think it is not >> possible at >> all (maybe someone could confirm this): >> >> All processes are forked or run in a separate shell and so in >> a separate >> environment. Changing this environment does not affect the environment >> from which I'm calling ant. >> >> >> >> Any ideas ? Windows-System calls ? Python calls ? >> >> >> >> Thanks, >> >> Philipp >> >> >> >> >> >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org