http://www.perlmonks.org?node_id=484807

THuG has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to automate a Cisco VPN client. It has a command line interface, but it appears to be interactive only. You still have to type in your Id. and password at prompts. You can't pass these values when you call the connect command, despite the fact that these appear to be valid arguments.

Is there a Windows equivalent of the Expect module or some other strategy I could use?

Replies are listed 'Best First'.
Re: Windows Expect?
by JSchmitz (Canon) on Aug 18, 2005 at 18:24 UTC
    If you use the Cygwin environment which brings its own Perl, and have the latest IO::Tty (v0.05) installed, it should work
    cheers -

    Jeffery
Re: Windows Expect?
by decnartne (Beadle) on Aug 19, 2005 at 14:15 UTC
    To address the initial problem with perhaps a silly question - does the user have write access to the vpnprofilename.pcf file? I was successful using the cli w/ the 4.6.03.0021 client on XP SP2 and noticed from the Cisco docs and in watching the timestamp that this file is mod'd at execution. Also, if the user/password combo are wrong, the dialog box pops up, however, I'll assume that this is not what's tripping up the client.

    Anyway, if you are unsuccessful, for whatever reason, on the cygwin/io::tty route, perhaps something like AutoIt3 would help out (it allows scripting of mouse/keypress events). YMMV, of course, depending on organization constraints.

    decnartne ~ entranced