WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Program name containing space in a DOS batch file

 
   Home -> Windows Other -> MS DOS Apps RSS
Next:  Help...again.  
Author Message
Ciarán Ó Duibhín

External


Since: Sep 02, 2007
Posts: 4



(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

Thanks.
Ciarán Ó Duibhín.
Back to top
Login to vote
Alan Edwards

External


Since: Apr 25, 2004
Posts: 5838



(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

....Alan
--
Alan Edwards, MS MVP Windows - Internet Explorer
http://dts-l.org/index.htm



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.
Back to top
Login to vote
Ciarán Ó Duibhín

External


Since: Sep 02, 2007
Posts: 4



(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....
Back to top
Login to vote
Jeff Richards

External


Since: Mar 14, 2004
Posts: 2429



(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.
>
Back to top
Login to vote
Display posts from previous:   
       Home -> Windows Other -> MS DOS Apps 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
Categories:
 Windows XP
 Windows Vista
  Windows Other
 Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET