# From Ruby: Calling a DOS batch file, waiting for it to finis

**URL:** <https://www.ruby-forum.com/t/from-ruby-calling-a-dos-batch-file-waiting-for-it-to-finis/75042>\
**Category:** Ruby\
**Created:** [November 7, 2006, 11:07am UTC](https://www.ruby-forum.com/t/from-ruby-calling-a-dos-batch-file-waiting-for-it-to-finis/75042 "2006-11-07T11:07:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glenn\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bbce88/32.png) [@Glenn\_S](https://www.ruby-forum.com/u/Glenn_S)\
**Post date:** [November 7, 2006, 11:07am UTC](https://www.ruby-forum.com/t/from-ruby-calling-a-dos-batch-file-waiting-for-it-to-finis/75042/1 "2006-11-07T11:07:45Z")

</div>

Help!

Can somebody point me at the best way to call a DOS batch file, and wait  
for  
it to finish. The batch file itself will be running a number of  
commands,  
including sqlloader. Ruby needs to wait for it to finish before  
continuing.

What is the way to do this please? Pretty please?

Thanks awfully!

---

<div class="post-metadata">

**Author:** ![Glenn\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bbce88/32.png) [@Glenn\_S](https://www.ruby-forum.com/u/Glenn_S)\
**Post date:** [November 7, 2006, 11:07am UTC](https://www.ruby-forum.com/t/from-ruby-calling-a-dos-batch-file-waiting-for-it-to-finis/75042/2 "2006-11-07T11:07:45Z")

</div>

Forget it - think I’ve just figured out the system call does just that  
(unless anybody knows a good reason why I shouldn’t go down this  
method?)

On 06/11/06, Glenn S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks awfully!

–

All the best  
Glenn  
Aylesbury, UK

---

<div class="post-metadata">

**Author:** ![Glenn\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bbce88/32.png) [@Glenn\_S](https://www.ruby-forum.com/u/Glenn_S)\
**Post date:** [March 12, 2009, 3:12pm UTC](https://www.ruby-forum.com/t/from-ruby-calling-a-dos-batch-file-waiting-for-it-to-finis/75042/3 "2009-03-12T15:12:44Z")

</div>

Hi Glenn

I am interested to know how you resolved your issue. I know that I am  
years behind on requesting this…but thought I’d give it a shot. 🙂  
Thanks

-MC
