From: RichardOnRails on
I've got a 3-line bat file:
rake ready_for_the_day
@echo ------
rake COFFEE_CUPS=5 make_coffee

(BTW: Rake is Ruby's version of make: it invokes Ruby commands rather
the U*ix cmds. The arguments identify a task within a Rakefile in the
current directory, possibly with settings for environment variables)

The above ,bat file invokes the first command successfully, AFAIK, and
then quits
When I comment out the first cmd with a leading colon the echo works,
as does the 2nd cmd

Could a Rake.exe shut down the batch cmd that invoked it. If so, is
there any way I could insulate the batch command file from such a
shutdown attempt?

Thanks in Advance,
Richard
From: RichardOnRails on
On Jul 11, 1:32 pm, RichardOnRails
<RichardDummyMailbox58...(a)USComputerGurus.com> wrote:
> I've got a 3-line bat file:
>     rake ready_for_the_day
>     @echo ------
>     rake COFFEE_CUPS=5 make_coffee
>
> (BTW: Rake is Ruby's version of make: it invokes Ruby commands rather
> the U*ix cmds.  The arguments identify a task within a Rakefile in the
> current directory, possibly with settings for environment variables)
>
> The above ,bat file invokes the first command successfully, AFAIK, and
> then quits
> When I comment out the first cmd with a leading colon the echo works,
> as does the 2nd cmd
>
> Could a Rake.exe shut down the batch cmd that invoked it.  If so,  is
> there any way I could insulate the batch command file from such a
> shutdown attempt?
>
> Thanks in Advance,
> Richard

Problem solved:
Sorry, folks. I just remembered this question I similar to one I
asked the other day.
There the answer was "invoked commands like rake as follows:
cmd /c the.exe
That worked here, too.

Best wishes,
Richard
From: Pegasus [MVP] on


"RichardOnRails" <RichardDummyMailbox58407(a)USComputerGurus.com> wrote in
message
news:cd697713-6125-4a9b-8cce-944b99275fe5(a)w12g2000yqj.googlegroups.com...
> I've got a 3-line bat file:
> rake ready_for_the_day
> @echo ------
> rake COFFEE_CUPS=5 make_coffee
>
> (BTW: Rake is Ruby's version of make: it invokes Ruby commands rather
> the U*ix cmds. The arguments identify a task within a Rakefile in the
> current directory, possibly with settings for environment variables)
>
> The above ,bat file invokes the first command successfully, AFAIK, and
> then quits
> When I comment out the first cmd with a leading colon the echo works,
> as does the 2nd cmd
>
> Could a Rake.exe shut down the batch cmd that invoked it. If so, is
> there any way I could insulate the batch command file from such a
> shutdown attempt?
>
> Thanks in Advance,
> Richard

Try this:
@echo off
start /b rake ready_for_the_day
echo Label 1
pause
rake COFFEE_CUPS=5 make_coffee

Note also that you should include full paths for all file names referenced
in batch files if you want the batch file to be robust. Rake.exe has no path
in your example.

From: RichardOnRails on
On Jul 11, 1:58 pm, "Pegasus [MVP]" <n...(a)microsoft.com> wrote:
> "RichardOnRails" <RichardDummyMailbox58...(a)USComputerGurus.com> wrote in
> messagenews:cd697713-6125-4a9b-8cce-944b99275fe5(a)w12g2000yqj.googlegroups..com...
>
>
>
> > I've got a 3-line bat file:
> >    rake ready_for_the_day
> >    @echo ------
> >    rake COFFEE_CUPS=5 make_coffee
>
> > (BTW: Rake is Ruby's version of make: it invokes Ruby commands rather
> > the U*ix cmds.  The arguments identify a task within a Rakefile in the
> > current directory, possibly with settings for environment variables)
>
> > The above ,bat file invokes the first command successfully, AFAIK, and
> > then quits
> > When I comment out the first cmd with a leading colon the echo works,
> > as does the 2nd cmd
>
> > Could a Rake.exe shut down the batch cmd that invoked it.  If so,  is
> > there any way I could insulate the batch command file from such a
> > shutdown attempt?
>
> > Thanks in Advance,
> > Richard
>
> Try this:
> @echo off
> start /b rake ready_for_the_day
> echo Label 1
> pause
> rake COFFEE_CUPS=5 make_coffee
>
> Note also that you should include full paths for all file names referenced
> in batch files if you want the batch file to be robust. Rake.exe has no path
> in your example.

Hi Pegasys,

Thanks for your response.

> Rake.exe has no path in your example.
True, but Rake's path is provided in my installation of Ruby: K:/
_Utilities/ruby186-26_rc2/ruby/bin/ (BTW, Ruby adjusts path
separators to the OS environment.)

I looked up the specs on cmd and start. It looks like they were drawn
up by lawyers :-)
In your view, is there a reason to prefer "start /b" to "cmd /c"?

Thanks in Advance,
Richard
From: pjp on
I'm coming in late on this but given the subject of thread ... I wrote a
program (EXE) years ago as a menu front end that rewrote the batch file it
was invoked from. The edits were what got parsed when the exe finished, the
new line(s) executed, returned to batch file, looped to top of it, reinvoked
exe which would change it again to new selection etc. etc. In other words
the batch file got reparsed after return from the exe.

"RichardOnRails" <RichardDummyMailbox58407(a)USComputerGurus.com> wrote in
message
news:554c88b1-04fc-42ce-8d8f-9908f917b77f(a)e6g2000vbp.googlegroups.com...
On Jul 11, 1:58 pm, "Pegasus [MVP]" <n...(a)microsoft.com> wrote:
> "RichardOnRails" <RichardDummyMailbox58...(a)USComputerGurus.com> wrote in
> messagenews:cd697713-6125-4a9b-8cce-944b99275fe5(a)w12g2000yqj.googlegroups.com...
>
>
>
> > I've got a 3-line bat file:
> > rake ready_for_the_day
> > @echo ------
> > rake COFFEE_CUPS=5 make_coffee
>
> > (BTW: Rake is Ruby's version of make: it invokes Ruby commands rather
> > the U*ix cmds. The arguments identify a task within a Rakefile in the
> > current directory, possibly with settings for environment variables)
>
> > The above ,bat file invokes the first command successfully, AFAIK, and
> > then quits
> > When I comment out the first cmd with a leading colon the echo works,
> > as does the 2nd cmd
>
> > Could a Rake.exe shut down the batch cmd that invoked it. If so, is
> > there any way I could insulate the batch command file from such a
> > shutdown attempt?
>
> > Thanks in Advance,
> > Richard
>
> Try this:
> @echo off
> start /b rake ready_for_the_day
> echo Label 1
> pause
> rake COFFEE_CUPS=5 make_coffee
>
> Note also that you should include full paths for all file names referenced
> in batch files if you want the batch file to be robust. Rake.exe has no
> path
> in your example.

Hi Pegasys,

Thanks for your response.

> Rake.exe has no path in your example.
True, but Rake's path is provided in my installation of Ruby: K:/
_Utilities/ruby186-26_rc2/ruby/bin/ (BTW, Ruby adjusts path
separators to the OS environment.)

I looked up the specs on cmd and start. It looks like they were drawn
up by lawyers :-)
In your view, is there a reason to prefer "start /b" to "cmd /c"?

Thanks in Advance,
Richard


 |  Next  |  Last
Pages: 1 2
Prev: Sound plays automatically
Next: Outlook Express