Path: csiph.com!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Nigel Wade Newsgroups: comp.lang.java.programmer Subject: Re: Space in 'My Documents' directory not fixed by quoting or \ escaping Date: Tue, 29 May 2012 13:58:08 +0100 Lines: 32 Message-ID: References: <4fc4c1cb$0$6931$e4fe514c@news2.news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net INlFm/K1rv1Mxcg2vo+ESQrAFPR80KnVTFaxNehK4Q9rANcSwU16dy/md9iRS4ckrD Cancel-Lock: sha1:fCLquN/SfEMRHB8D2gWVJtp9lJg= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0 In-Reply-To: <4fc4c1cb$0$6931$e4fe514c@news2.news.xs4all.nl> Xref: csiph.com comp.lang.java.programmer:14880 On 29/05/12 13:32, Silvio Bierman wrote: > On 05/29/2012 02:16 PM, bilsch wrote: >> I'm writing a DOS script that uses pathnames with the well known Windows >> directory 'My Documents'. The name has a space in it that causes javac >> and java commands to choke. Neither of the following works: >> 'My Documents' (single quotes) or My\ Documents (escape the space). >> Here is an example: >> >> javac -d C:/Users/Owner/'My Documents'/NetBeansProjects/%1/build/classes >> >> Can anyone tell me the workaround for this? >> >> TIA Bill S. > > Not really Java related but anyway: in DOS/Windows you need to quote the > complete path like "C:/My Documents/Pictures/abc.WMV" etc. > it's often very convenient to use tab expansion of paths (both in Windows cmd shell, and UNIX/Linux bash shell). This would have discovered the correct path for the OP. For example, enter in the cmd.exe: javac -d C:\Users\Owner\My then hit tab. Windows will do the rest, even adding appropriate quotes where necessary. Note that you must use the Windows \ path separator for this to work. -- Nigel Wade