Assumptions:
- The telnet endpoint you are communicating with doesn't have any other ways of exposing itself (like a ReST API or anything)
- The commands will always be run from some Windows machine
Open questions:
- What versions of Windows will you be running this script from?
I'd recommend you do this via Powershell as opposed to writing a batch or CMD file. Getting direct access to .NET classes and objects and the ability to programmatically handle errors and output formatting in a Windows native way would be a strong approach. It also keeps you current with technology from the standpoint of upkeep in the future.
Powershell is the way forward on Windows, even though other things could work, like Python, etc.