Use putty as library - http://marknelson.us/2011/10/11/automating-putty/