Yeah, it would be neater to do it from your app, but then you have the hassle of filling in ID/Password, etc, to completely restart TWS, if I'm understanding the OP correctly.
Walter:
With AutoIt you can use cursor position, or window functions. Definitely is a learning curve, but it is...