# Winole prob or not

**URL:** <https://www.ruby-forum.com/t/winole-prob-or-not/125383>\
**Category:** Ruby\
**Created:** [January 8, 2008, 6:46pm UTC](https://www.ruby-forum.com/t/winole-prob-or-not/125383 "2008-01-08T18:46:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [January 8, 2008, 6:46pm UTC](https://www.ruby-forum.com/t/winole-prob-or-not/125383/1 "2008-01-08T18:46:04Z")

</div>

hello  
i am chcking if i have the app amibroker instance running. if it is, i  
want to close it smoothly. however i land into a ole problem here. it  
only quits 1 instance at a single run. for eg. if i i have 3  
instances running and i execute the following script. it will close 1  
instance leaving 2 open. if i run it again, it will close another  
instance leaving 1 open. is it a win32ole prob or amibroker prob.

def closeAB  
application = WIN32OLE.new(“Broker.Application”)  
application.quit  
puts “called to close”  
end

# Everything

ProcTable.ps.each { |p|  
if(p.caption ==“Broker.exe”) then  
# close amibroker  
puts " found ab"  
closeAB

```
  end

```

}
