0
votes

I am trying to spawn an telnet session through an expect script. But when I try to execute the script, I get the following error

spawn telnet xx.xx.xx.xx couldn't execute "telnet": no such file or directory while executing "spawn telnet [lindex $argv 0]"

I am trying to run the script on windows 2008 server R2.

I faced the same error even after executing the "spawn telnet" manually in the expect shell.

What could be problem?

2

2 Answers

0
votes

telnet application is not installed?

Install Telnet Client

Open a command prompt window. Click Start, type cmd in the Start Search box, and then press ENTER.

Type the following command:

pkgmgr /iu:"TelnetClient"

If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.

When the command prompt appears again, the installation is complete.

If using cygwin you will need to install the inetutils package.

0
votes

I had a similar problem. I resolved this issue by downloading plink.exe and placing it in the same folder as my expect script. The download is located here. I then called it using spawn plink -telnet $ipaddress