(Msg. 1) Posted: Sun Sep 02, 2007 2:59 am
Post subject: Program name containing space in a DOS batch file Archived from groups: microsoft>public>win95>msdosapps (more info?)
I can't put a line like this in a DOS batch file
C:\Program Files\someprog
because of the space. Message is:
'C:\Program' is not recognized as an internal or external command, operable
program or batch file.
Putting quotes around it doesn't work. Message is:
'"C:\Program Files\someprog"' is not recognized as an internal or
external....
How can I get around it?
I should explain that in real life the line actually looks like this:
firstprog | %MYVAR%
where the value of MYVAR is as above
(Msg. 2) Posted: Sun Sep 02, 2007 3:01 am
Post subject: Re: Program name containing space in a DOS batch file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Use the abbreviated (8.3) name instead.
e.g. C:\PROGRA~1\SOMEPROG.EXE
On Sun, 2 Sep 2007 02:59:13 +0100, in
microsoft.public.win95.msdosapps, "Ciarán Ó Duibhín"
<ciaran.DeleteThis@oduibhin.freeserve.co.uk> wrote:
>I can't put a line like this in a DOS batch file
>
>C:\Program Files\someprog
>
>because of the space. Message is:
>
>'C:\Program' is not recognized as an internal or external command, operable
>program or batch file.
>
>Putting quotes around it doesn't work. Message is:
>
>'"C:\Program Files\someprog"' is not recognized as an internal or
>external....
>
>How can I get around it?
>
>I should explain that in real life the line actually looks like this:
> firstprog | %MYVAR%
>where the value of MYVAR is as above
>
>Thanks.
>Ciarán Ó Duibhín.
(Msg. 3) Posted: Sun Sep 02, 2007 12:48 pm
Post subject: Re: Program name containing space in a DOS batch file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Apologies for my mistake. The quotes work after all. (The problem was that
I had inadvertently renamed someprog.exe).
Thanks for the responses,
Ciarán Ó Duibhín.
"Ciarán Ó Duibhín" wrote in message
news:#MG5CYQ7HHA.4736@TK2MSFTNGP06.phx.gbl...
> I can't put a line like this in a DOS batch file
>
> C:\Program Files\someprog
>
> because of the space. Message is:
>
> 'C:\Program' is not recognized as an internal or external command,
operable
> program or batch file.
>
> Putting quotes around it doesn't work. Message is:
>
> '"C:\Program Files\someprog"' is not recognized as an internal or
> external....
(Msg. 4) Posted: Sun Sep 02, 2007 5:49 pm
Post subject: Re: Program name containing space in a DOS batch file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Try
"C:\Program Files\someprog.EXE"
(or COM or BAT or whatever it is ).
--
Jeff Richards
MS MVP (Windows - Shell/User)
"Ciarán Ó Duibhín" <ciaran.DeleteThis@oduibhin.freeserve.co.uk> wrote in message
news:%23MG5CYQ7HHA.4736@TK2MSFTNGP06.phx.gbl...
>I can't put a line like this in a DOS batch file
>
> C:\Program Files\someprog
>
> because of the space. Message is:
>
> 'C:\Program' is not recognized as an internal or external command,
> operable
> program or batch file.
>
> Putting quotes around it doesn't work. Message is:
>
> '"C:\Program Files\someprog"' is not recognized as an internal or
> external....
>
> How can I get around it?
>
> I should explain that in real life the line actually looks like this:
> firstprog | %MYVAR%
> where the value of MYVAR is as above
>
> Thanks.
> Ciarán Ó Duibhín.
>
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum