Using Ruby to Close Outlook

First you will need to Install Ruby. Make sure the {ruby install path}/bin is in your path. Then run this script.

require 'win32ole'
outlook = WIN32OLE.new('outlook.application')
outlook.quit

I used this in conjunction with my backup script by making sure to close Outlook before I started a backup, this way I was sure to get the Outlook files (.pst) backed up with everything else.