A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Can an .exe invoked from a .bat file shut down execution of latercmds?



 
 
Thread Tools Display Modes
  #1  
Old July 11th 10, 06:32 PM posted to microsoft.public.windowsxp.general
RichardOnRails
external usenet poster
 
Posts: 104
Default Can an .exe invoked from a .bat file shut down execution of latercmds?

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
Ads
  #2  
Old July 11th 10, 06:56 PM posted to microsoft.public.windowsxp.general
RichardOnRails
external usenet poster
 
Posts: 104
Default Can an .exe invoked from a .bat file shut down execution of latercmds?

On Jul 11, 1:32*pm, RichardOnRails
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
  #3  
Old July 11th 10, 06:56 PM posted to microsoft.public.windowsxp.general
RichardOnRails
external usenet poster
 
Posts: 104
Default Can an .exe invoked from a .bat file shut down execution of latercmds?

On Jul 11, 1:32*pm, RichardOnRails
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
  #4  
Old July 11th 10, 06:58 PM posted to microsoft.public.windowsxp.general
Pegasus [MVP]
external usenet poster
 
Posts: 2,361
Default Can an .exe invoked from a .bat file shut down execution of later cmds?



"RichardOnRails" wrote in
message
...
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.

  #5  
Old July 11th 10, 06:58 PM posted to microsoft.public.windowsxp.general
Pegasus [MVP]
external usenet poster
 
Posts: 2,361
Default Can an .exe invoked from a .bat file shut down execution of later cmds?



"RichardOnRails" wrote in
message
...
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.

  #6  
Old July 12th 10, 10:13 PM posted to microsoft.public.windowsxp.general
RichardOnRails
external usenet poster
 
Posts: 104
Default Can an .exe invoked from a .bat file shut down execution of latercmds?

On Jul 11, 1:58*pm, "Pegasus [MVP]" wrote:
"RichardOnRails" wrote in
...



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
  #7  
Old July 12th 10, 10:13 PM posted to microsoft.public.windowsxp.general
RichardOnRails
external usenet poster
 
Posts: 104
Default Can an .exe invoked from a .bat file shut down execution of latercmds?

On Jul 11, 1:58*pm, "Pegasus [MVP]" wrote:
"RichardOnRails" wrote in
...



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
  #8  
Old July 12th 10, 10:29 PM posted to microsoft.public.windowsxp.general
pjp[_3_]
external usenet poster
 
Posts: 38
Default Can an .exe invoked from a .bat file shut down execution of later cmds?

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" wrote in
message
...
On Jul 11, 1:58 pm, "Pegasus [MVP]" wrote:
"RichardOnRails" wrote in
...



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


  #9  
Old July 12th 10, 10:29 PM posted to microsoft.public.windowsxp.general
pjp[_3_]
external usenet poster
 
Posts: 38
Default Can an .exe invoked from a .bat file shut down execution of later cmds?

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" wrote in
message
...
On Jul 11, 1:58 pm, "Pegasus [MVP]" wrote:
"RichardOnRails" wrote in
...



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


  #10  
Old July 12th 10, 11:19 PM posted to microsoft.public.windowsxp.general
Pegasus [MVP]
external usenet poster
 
Posts: 2,361
Default Can an .exe invoked from a .bat file shut down execution of later cmds?



"RichardOnRails" wrote in
message
...
On Jul 11, 1:58 pm, "Pegasus [MVP]" wrote:
"RichardOnRails" wrote in
...



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


"Start" and "cmd" are different things.

"Start" creates a new thread, one that is independent from the current
thread. You use it when you want to invoke two processes that are
independent of each other..

"Cmd" spawns another instance of the Command Processor. In other words, it
causes the batch file to go off at a tangent. However, the batch file will
not continue until the new command processor finishes its job.

The complexity of switches that worries you is a delight for programmers
because it gives them great flexibility.

  #11  
Old July 12th 10, 11:19 PM posted to microsoft.public.windowsxp.general
Pegasus [MVP]
external usenet poster
 
Posts: 2,361
Default Can an .exe invoked from a .bat file shut down execution of later cmds?



"RichardOnRails" wrote in
message
...
On Jul 11, 1:58 pm, "Pegasus [MVP]" wrote:
"RichardOnRails" wrote in
...



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


"Start" and "cmd" are different things.

"Start" creates a new thread, one that is independent from the current
thread. You use it when you want to invoke two processes that are
independent of each other..

"Cmd" spawns another instance of the Command Processor. In other words, it
causes the batch file to go off at a tangent. However, the batch file will
not continue until the new command processor finishes its job.

The complexity of switches that worries you is a delight for programmers
because it gives them great flexibility.

  #12  
Old July 13th 10, 01:21 AM posted to microsoft.public.windowsxp.general
RichardOnRails
external usenet poster
 
Posts: 104
Default Can an .exe invoked from a .bat file shut down execution of latercmds?

On Jul 12, 6:19*pm, "Pegasus [MVP]" wrote:
"RichardOnRails" wrote in
...



On Jul 11, 1:58 pm, "Pegasus [MVP]" wrote:
"RichardOnRails" wrote in
...


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


"Start" and "cmd" are different things.

"Start" creates a new thread, one that is independent from the current
thread. You use it when you want to invoke two processes that are
independent of each other..

"Cmd" spawns another instance of the Command Processor. In other words, it
causes the batch file to go off at a tangent. However, the batch file will
not continue until the new command processor finishes its job.

The complexity of switches that worries you is a delight for programmers
because it gives them great flexibility.


Excellent explanation. I'll think about this if I decide to resume
this batch-file approach.
I just started exploring a perhaps more appropriate way to executing
my commands successively: Using Rake, which a a Ruby version of the
venerable Un*x make utility. But that's in suspense while I work on a
more pressing problem.

But thanks for illuminating this issue for me.

Best wishes,
Richard
  #13  
Old July 13th 10, 01:21 AM posted to microsoft.public.windowsxp.general
RichardOnRails
external usenet poster
 
Posts: 104
Default Can an .exe invoked from a .bat file shut down execution of latercmds?

On Jul 12, 6:19*pm, "Pegasus [MVP]" wrote:
"RichardOnRails" wrote in
...



On Jul 11, 1:58 pm, "Pegasus [MVP]" wrote:
"RichardOnRails" wrote in
...


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


"Start" and "cmd" are different things.

"Start" creates a new thread, one that is independent from the current
thread. You use it when you want to invoke two processes that are
independent of each other..

"Cmd" spawns another instance of the Command Processor. In other words, it
causes the batch file to go off at a tangent. However, the batch file will
not continue until the new command processor finishes its job.

The complexity of switches that worries you is a delight for programmers
because it gives them great flexibility.


Excellent explanation. I'll think about this if I decide to resume
this batch-file approach.
I just started exploring a perhaps more appropriate way to executing
my commands successively: Using Rake, which a a Ruby version of the
venerable Un*x make utility. But that's in suspense while I work on a
more pressing problem.

But thanks for illuminating this issue for me.

Best wishes,
Richard
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 08:26 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.