Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #14880

Re: Space in 'My Documents' directory not fixed by quoting or \ escaping

From Nigel Wade <nmw@ion.le.ac.uk>
Newsgroups comp.lang.java.programmer
Subject Re: Space in 'My Documents' directory not fixed by quoting or \ escaping
Date 2012-05-29 13:58 +0100
Message-ID <a2jvh9FuhU1@mid.individual.net> (permalink)
References <jq2eme$o07$1@dont-email.me> <4fc4c1cb$0$6931$e4fe514c@news2.news.xs4all.nl>

Show all headers | View raw


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

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Space in 'My Documents' directory not fixed by quoting or \ escaping bilsch <bilsch01@gmail.com> - 2012-05-29 05:16 -0700
  Re: Space in 'My Documents' directory not fixed by quoting or \ escaping Silvio Bierman <silvio@moc.com> - 2012-05-29 14:32 +0200
    Re: Space in 'My Documents' directory not fixed by quoting or \ escaping Nigel Wade <nmw@ion.le.ac.uk> - 2012-05-29 13:58 +0100
      Re: Space in 'My Documents' directory not fixed by quoting or \ escaping Lew <noone@lewscanon.com> - 2012-05-29 07:06 -0700
        Re: Space in 'My Documents' directory not fixed by quoting or \ escaping Gene Wirchenko <genew@ocis.net> - 2012-05-29 09:27 -0700
          Re: Space in 'My Documents' directory not fixed by quoting or \ escaping Lew <lewbloch@gmail.com> - 2012-05-29 14:07 -0700
            Re: Space in 'My Documents' directory not fixed by quoting or \ escaping glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-05-29 21:43 +0000
              Re: Space in 'My Documents' directory not fixed by quoting or \ escaping Jim Janney <jjanney@shell.xmission.com> - 2012-05-29 16:37 -0600
            Re: Space in 'My Documents' directory not fixed by quoting or \ escaping Gene Wirchenko <genew@ocis.net> - 2012-05-29 14:55 -0700
              Re: Space in 'My Documents' directory not fixed by quoting or \ escaping bilsch <bilsch01@gmail.com> - 2012-05-29 16:06 -0700
                Re: Space in 'My Documents' directory not fixed by quoting or \ escaping Lew <noone@lewscanon.com> - 2012-06-02 09:31 -0700
                Re: Space in 'My Documents' directory not fixed by quoting or \ escaping Gene Wirchenko <genew@ocis.net> - 2012-06-03 19:23 -0700
        Re: Space in 'My Documents' directory not fixed by quoting or \ escaping bilsch <bilsch01@gmail.com> - 2012-05-29 12:55 -0700
        Re: Space in 'My Documents' directory not fixed by quoting or \ escaping Nigel Wade <nmw@ion.le.ac.uk> - 2012-05-30 10:30 +0100
      Re: Space in 'My Documents' directory not fixed by quoting or \ escaping bilsch <bilsch01@gmail.com> - 2012-05-29 12:54 -0700
    Re: Space in 'My Documents' directory not fixed by quoting or \ escaping bilsch <bilsch01@gmail.com> - 2012-05-29 12:50 -0700
  Re: Space in 'My Documents' directory not fixed by quoting or \ escaping "Mike Schilling" <mscottschilling@hotmail.com> - 2012-05-29 07:31 -0700
    Re: Space in 'My Documents' directory not fixed by quoting or \ escaping bilsch <bilsch01@gmail.com> - 2012-05-29 12:59 -0700

csiph-web