Another option would be to use plink (the command line ssh client that comes with PuTTY). AFAIK, it doesn't try to emulate TTYs in Windows so it would be easier to automate than OpenSSH ssh client.
Comment on Re^3: Unable to run command on Cisco switch
Thanks for that. I used plink.
The -m option did not work, so I redirected STDIN and it all works fine.
The gotcha I discovered was that cisco switch was being parsed \r\n as newline. So that made going into enable mode a bit tricky. But that all sorted now by sending my command and a \r.
Thanks.