Ryan Allan wrote: > Hi everybody, > > I'm trying to add a callback to a ShellExecute call. (Or at least get > some way to find out when it finishes running.) I'm not having any luck > with WIN32OLE_EVENT, and all the examples I can find use Internet > Explorer or Excel. > > The code: > > shell=WIN32OLE.new('Shell.Application') > > shell.ShellExecute(file_to_use, arguments, directory, operation, show) > #All of these arguments are defined earlier. This call does what I want. > (...) > -Ryan You need ShellExecuteEx (see http://www.codeproject.com/KB/system/newbiespawn.aspx ), but win32ole doesn't seem to support ShellExecuteEx. This is what I use in such cases (winXP) : system('start /w notepad') # waits until notepad exits system('start calc') # does not wait puts "calc should be running, bye." hth, Siep -- Posted via http://www.ruby-forum.com/.