Unfortunately telnet.exe is not scriptable, you'd have to look into other programs such as SecureCRT or putty.