- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Windows bat files
Sun, 2011-09-11, 21:55
I have a hello.bat file with the following contents
@scala -cp classes Hello
@echo one
@echo two
@scala -cp classes Hello
The first Hello program runs, but the bat file execution stops right
after that, so none of the rest of the command lines get executed.
What's up with that? Why does the bat file terminate after running the
Scala program?
On the other hand the following bat file runs properly as expected
@java -cp classes Hello
@echo one
@echo two
@java -cp classes Hello
Cheers, Eric
Mon, 2011-09-12, 00:47
#2
Re: Re: Windows bat files
Thanks - that does the trick. Now I feel so dumb.
I wasn't paying attention to what is in %SCALA_HOME%\bin - it's all
script files.
Cheers, Eric
On 2011-09-11 2:38 PM, Dave wrote:
> scala is a batch file: scala.bat
> If you want to call a batch file from a batch file and return control
> to the main batch file you use call
> like so
>
> @call scala -cp classes Hello
> @echo one
> @echo two
> @call scala -cp classes Hello
>
> On 11 sep, 22:55, Eric Kolotyluk wrote:
>> I have a hello.bat file with the following contents
>>
>> @scala -cp classes Hello
>> @echo one
>> @echo two
>> @scala -cp classes Hello
>>
>> The first Hello program runs, but the bat file execution stops right
>> after that, so none of the rest of the command lines get executed.
>>
>> What's up with that? Why does the bat file terminate after running the
>> Scala program?
>>
>> On the other hand the following bat file runs properly as expected
>>
>> @java -cp classes Hello
>> @echo one
>> @echo two
>> @java -cp classes Hello
>>
>> Cheers, Eric
scala is a batch file: scala.bat
If you want to call a batch file from a batch file and return control
to the main batch file you use call
like so
@call scala -cp classes Hello
@echo one
@echo two
@call scala -cp classes Hello
On 11 sep, 22:55, Eric Kolotyluk wrote:
> I have a hello.bat file with the following contents
>
> @scala -cp classes Hello
> @echo one
> @echo two
> @scala -cp classes Hello
>
> The first Hello program runs, but the bat file execution stops right
> after that, so none of the rest of the command lines get executed.
>
> What's up with that? Why does the bat file terminate after running the
> Scala program?
>
> On the other hand the following bat file runs properly as expected
>
> @java -cp classes Hello
> @echo one
> @echo two
> @java -cp classes Hello
>
> Cheers, Eric