Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?ISO-8859-1?Q?Sven_K=F6hler?= Newsgroups: comp.lang.java.programmer Subject: Re: exec problem is JDK 1.7.0_21 Date: Tue, 23 Apr 2013 23:31:14 +0300 Lines: 15 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: news.dfncis.de kirFNmHGFVUi8vGg4UeVVgRL+ipNmDDCWeb8fB07eAAQRdXKFRp8jZwkDG Cancel-Lock: sha1:TLB98Cfi16vABM2zPvAHr6tuSXY= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130408 Thunderbird/17.0.5 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:23599 Am 23.04.2013 21:56, schrieb Steven Simpson: > $ java WindowsArgumentGenerator 'c:\program files\\\' 'world' > argv[0]=[c:\program files\\\] > argv[1]=[world] > "c:\program files"\\\ world That doesn't look right. A correct escaping would be "c:\program files\\\\\\" world You have to double the number of backslashes if they preceed a quote. Also, you have to add another backslash if the quote does not terminate the argument. Here's my attempt to the do the escaping: http://sourceforge.net/p/lejos/code/HEAD/tree/trunk/org.lejos.nxt.ldt/src/main/java/org/lejos/nxt/ldt/util/LeJOSNXJUtil.java#l421