This should take care of it, a much simpler solution that delegates actually running the opened program to the windows shell so that should provide completely clean separation of the calibre environmet from that of the launched application.
https://github.com/kovidgoyal/calibr...1a065bfde4f6e0