Some of the alternatives listed look interesting, but in many ways they fall short.
The big problem you have is that the telnet.exe supplied by Microsoft does not do its console I/O via stdin and stdout. I found another "telnet" program at SourceForge called "Console Telnet" or "Telnet-Win32" (aliases) that
promises this capability, but in my tests fails miserably to deliver... i.e. I couldn't get it to work.
Some of the tools at the links above are downright ludricrous (they don't seem to have any idea what Telnet really is). Other show some promise (such as the one referenced at the
dbforums link above), but clearly were written by a non-native English speaker and have nearly unintelligible documentation. Might be great, but I haven't the patience to decipher them right now.
Your best bet might indeed be some 3rd party scriptable Telnet application, if you aren't set on running things from a WSH script.
Otherwise you will need to do this via some ActiveX component. But as I said, the ones above are either just fancy Winsock components in some cases, or possibly just what you need (but hard to figure out quickly) in other cases.
There are several commercial Telnet components however. Dart, Distinct, and Catalyst are well-known brands.
It appears that a script component could be written based upon Microsoft's Winsock control, the free SocketWrench control from Catalyst, or any of several other free Winsock controls. This would take some effort to do a good job though: a halfway-decent Telnet implementation involves dealing with option negotiation at least in a passive manner. For some applications you might get by with a Winsock component and just "hope for the best" (i.e. that the server you want to talk to is really dumb too). In your case the "server" is a switch.
You'd be home free if only you had a Telnet application that truly used stdin/stdout for console I/O. I think that's where we're stuck here.
Don't feel too bad, I don't think the problem is you (or us responding). See
for an idea how badly others hunger for the same capability. The answer given there might be just the ticket, I just don't see any followups beyond where somebody posted there erroneous attempt to use the "solution."
This is the
telscript solution that
dougcranston's last link points (ultimately) to. It's also the one that might work fine, except I can't make any sense out of its documentation. It looks more like an application supporting an ActiveX Automation interface (like Word, etc.) than an ActiveX component.
Maybe the lack of followups means this is a dead-end as well?