Help me to write as korn shell script

Hi..

This is step to telnet from linux to my window telnet server and run a program called CLISMS.exe. As your information, the program will be sent out a sms to my mobile number. The step as below:-

telnet 123.123.123.123
Trying 123.123.123.123...
Connected to 123.123.123.123.
Escape character is '^]'.
Welcome to Microsoft Telnet Service

login: ftpadmin
password:

*===============================================================
Welcome to Microsoft Telnet Server.
*===============================================================
C:\Documents and Settings\ftpadmin>cd \
C:\>CLISMS.exe /port=1 /to=0133034931 /msg=keke keke
C:\>exitConnection closed by foreign host.

The problem is how could i write the steps on korn shell script ?. Please help me..

I have write the script as below but the program look not executed and i not received the SMS. Why ?

(sleep 1; echo -e "ftpadmin\r"; sleep 1; echo -e "ftpadmin\r"; sleep 1; echo -e "cd \ \r"; sleep 1; echo -e "CLISMS.exe /port=1 /to=0133034931 /msg=keke keke\r"; sleep 5; echo -e "exit\r") | telnet 192.168.2.163

Thank you,
baharin

man expect

If you don't have expect, install it and read the document.