tags:

views:

314

answers:

5

I am using rake to build my project and I have a build.bat file similar to this:

@echo off
cls
rake

When I double click on build.bat the dos window pops up and shows all the progress but closes itself when the task is finished. Is there way to do a Console.ReadLine so that user can get a chance to see the log?

Thanks.

Updated:

I've tried below but didn't work. not sure why.

@echo off
cls
rake
pause
A: 

Oops... Misunderstood the question...

Pause is the way to go

Old answer:

you can pipe commands into your patch file...

try

build.bat < responsefile.txt
Heiko Hatzfeld
+4  A: 

pause will display:

Press any key to continue . . .

Steven Robbins
pause works. but... if i do rake then pause it didn't work
Jeffrey C
sorry, didn't realise rake was another batch file.
Steven Robbins
+2  A: 

Add the pause command to the end of your batch file:

@echo off
cls
rake
pause
Helen
didn't work if i put "pause" after "rake"
Jeffrey C
+7  A: 

Default interpreters from Microsoft are done in a way, that causes them exit when they reach EOF. If rake is another batch file, command interpreter switches to it and exits when rake interpretation is finished. To prevent this write:

@echo off
cls
call rake
pause

IMHO, call operator will lauch another instance of intepretator thereby preventing the current one interpreter from switching to another input file.

Basilevs
+1 Good catch...
Zhaph - Ben Duguid
it works!!! thanks
Jeffrey C
+2  A: 

My guess is that rake is a batch program. When you invoke it without call, then control doesn't return to your build.bat. Try:

@echo off
cls
CALL rake
pause
Aaron Digulla