in reply to The cmd sent to the remote telnet will not run
Maybe because you're not assigning anything to the key "#Errmode" ... the pound sign introduces a comment. You'll have to escape it.
BCE--Your punctuation skills are insufficient!