Force client close from external script/exe

I’m looking for a script/code that will close the main notes client, taking into account open sametime windows and unsaved drafts. Something like a forceclose that will save drafts and discard all open sametime messages.

This can be java/c++/c#/vbscript, I don’t care. I’ve looked through the java classes and the c++ dev code but I’m just not seeing anything (admittedly I haven’t touched c++ in years). I would just do a c# process.closemainwindow, but it stalls at all prompts of course. I would also just kill notes2, but we all know how bad that can be.

Even just a pointer in the right direction would be helpful. Heck, even just a clue as to how to hook the existing session would probably get me there. As you can probably guess I am not a notes dev, I’m the Citrix admin, and being asked to gracefully shut down notes when our sessions time out. The problem is that windows is just crushing notes on the logoff process and causing corruptions.

Thanks!

Nick