From: Nuralanur@... Date: 2005-09-24T01:40:54+09:00 Subject: A windows ole question - howto start an external application -------------------------------1127493646 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Hello, I would like to make Ruby run an external program - Maple - under Windows XP, write something to it and then close it. It would be nice to capture the output of that program, but that's not obligatory, since I could make that program write a file for itself. Following Hal Fulton's examples in "The Ruby Way", I tried two things without success so far: 1.) Adapt require "win32ole" word = WIN32OLE.new "Word.Application" word.visible = true # ... word.quit 2.) Adapt require "open3" filenames = %w[ file1 file2 this that another one_more ] inp, out, err = Open3.popen3("xargs", "ls", "-l") filenames.each { |f| inp.puts f } # Write to the process's stdin inp.close # Close is necessary! output = out.readlines # Read from its stdout errout = err.readlines # Also read from its stderr . The problem seems to be that I do not really know how to tell Ruby to start the right application - from the properties menu I get the information that it's file "C:\Programme\Maple 9.5\bin.win\maplew9.5.exe" that starts Maple, but this is simply not recognized correctly. Can anybody with Windows automation experience give me a hint how to find out what to substitute for "Word.Application" in word = WIN32OLE.new "Word.Application" in the first variant or what to substitute for "xargs" in inp, out, err = Open3.popen3("xargs", "ls", "-l") ? Thank you, Axel -------------------------------1127493646--