Something to consider is why you want to automate PuTTY. If the purpose of your question is to evaluate whether you can use the automated tool to connect to some other machine to execute commands at the command line, then a better question would be to ask whether the tool supports connecting to other machines.
For example, Watir (Web Application Testing in Ruby) is an open-source tool used for web application testing. But, if you need to execute commands on a remote machine, then it's possible to perform this task using the Net-SSH ruby gem.
"The single biggest problem in communication is the illusion that it has taken place."
-George Bernard Shaw, Irish playwright and Nobel Prize winner, 1856-1950