HAve a look at http://whynotwiki.com/Ruby_/_Process_management
which points to http://www.ruby-doc.org/ruby-1.9/classes/Open3.html

Looks like the writer of the former was working on linux so there may
be some gotchas on windows...

Cheers