How to start autoexpect ?

Posted by susja on 2010-11-11 08:10

I have a simple task i.e. run autoexpect program to automate telnet. I was able to do it on my Solaris box but I am stuck on my Windows XP box.
Here's what I did:
1. downloaded expect-5.43.tar to my local drive, untar it and have Expect located at C:\.... . I tried to execute 'autoexpect' but it says: "'autoexpect' is not recognized as an internal or external command"
2. I installed ActiveTcl 8.5.9. Successfully ran 'teacup install Expect'.
3. Here I'm blocked: how now I could execute autoexpect program?

thanks in advance

ActiveState Staff
Fri, 2010-11-12 14:53

As autoexpect is just a Tcl script, you need to make sure it points to the right tclsh in the #! line and uses 'package require Expect'.

susja | Fri, 2010-11-12 18:03

hi jeffh,
thanks a lot for reply, I changed original line in my autoexpect from:
#!../expect --

#! c:/tbd/tcl/bin/tclsh.exe
package require Expect

when I run autoexpect program I have this error:
'autoexpect' is not recognized as an internal or external command,
operable program or batch file.

what is wrong?

ActiveState Staff
Sat, 2010-11-13 14:16

On Windows (missed that part earlier), you have to work with the Windows mechanisms for script files. Give it a known, registered extension such as .tcl, or call tclsh with the script as the first path.

I believe that autoexpect requires the 'interact' command from Expect though, which is not part of the Windows port of Expect.

susja | Sat, 2010-11-13 17:43

Well ... I realized that I played with the unix version of Expect. So I downloaded windows version of Tcl, then ran 'teacup install Expect'.
Now I have expect package downloaded on my Windows system and I have expect.tcl.
Still my goal is to run autoexpect !
Could someone tell me if it's possible to run autoexpect under Windows and if it is how to do it.