Prev: transparency
Next: oratcl and 10g
From: Arun Gupta on 13 Dec 2006 00:07 Hi I am facinfg a problem in expect like spawn telnet telnet session opened i want to open hyperterminal using expect can any body help me for this . 1)open hyerterminal 2) after press etner 3) prompt comes like 192.168.100.5> 4) when above prompt comes send command like get system info 192.168.100.5>get system info. please help me if any body knows about this.
From: Arun Gupta on 13 Dec 2006 01:52 I tried spawn command and the path of hyperterminal exe file but error message was thrown. 'C:\expect_scripts\hypertrm.exe' is not a Win32 console application. while executing "spawn "C:/expect_scripts/hypertrm.exe" ip.ht" (file "./expect2.tcl" line 61) I also tried using exec command but that opens a new window and no further commands sent through script are acepted. On Dec 13, 10:07 am, "Arun Gupta" <arungupta....(a)gmail.com> wrote: > Hi > I am facinfg a problem in expect > like spawn telnet telnet session opened i want to open hyperterminal > using expect > > can any body help me for this . > > 1)open hyerterminal > > 2) after press etner > > 3) prompt comes like 192.168.100.5> > > 4) when above prompt comes send command like get system info > > 192.168.100.5>get system info. > > please help me if any body knows about this.
From: Wojciech Kocjan on 13 Dec 2006 04:02 Dnia 13-12-2006 o 07:52:37 Arun Gupta <arungupta.sbg(a)gmail.com> napisa�(a): > I tried spawn command and the path of hyperterminal exe file but error > message was thrown. > > > 'C:\expect_scripts\hypertrm.exe' is not a Win32 console application. > while executing > "spawn "C:/expect_scripts/hypertrm.exe" ip.ht" > (file "./expect2.tcl" line 61) > > > I also tried using exec command but that opens a new window and no > further commands sent through script are acepted. And I believe the error says everything. The issue is that hyperterminal is a Windows application, not a console one - although this might be confusing. Have you considered using telnet.exe from Windows or plink.exe from Putty? I tried spawning plink.exe and it did work for me - I was able to do some basic interaction with the unix host. C:\Documents and Settings\Administrator>plink PuTTY Link: command-line connection utility Release 0.58 Usage: plink [options] [user@]host [command] ("host" can also be a PuTTY saved session name) Options: -V print version information and exit -pgpfp print PGP key fingerprints and exit -v show verbose messages -load sessname Load settings from saved session -ssh -telnet -rlogin -raw force use of a particular protocol -P port connect to specified port -l user connect with specified username -batch disable all interactive prompts So you should be able to use -telnet if you want to interact with a telnet session. -- WK email (rot13): jbwpvrpuNGxbpwnaQBGbet
From: David Gravereaux on 13 Dec 2006 14:42 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Arun Gupta wrote: > 'C:\expect_scripts\hypertrm.exe' is not a Win32 console application. <proud_father> I'm glad I put in a check for subsystem by reading the PE header. ;) Bwaa Haa haa. </proud_father> No, you can not capture GUI applications because they don't write text to the system console. They write *whatever* to their own windows. Expect was designed to grab text sent to a console, by console applications such as telnet.exe, ftp.exe, net.exe, netstat.exe, cmd.exe, etc.. For automating windows GUI applications, you might consider "winbatch" instead of Tcl/Expect. - -- David Gravereaux <davygrvy(a)pobox.com> [species:human; planet:earth,milkyway(western spiral arm),alpha sector] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) iD8DBQFFgFezlZadkQh/RmERAis3AJ9IeLbPKorvZ3Rak8jdiHXjleQqIwCg3sTW bhTZ45R3weS3cPGGkUA5Kas= =WtKu -----END PGP SIGNATURE-----
From: David Gravereaux on 14 Dec 2006 19:08 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Gravereaux wrote: > For automating windows GUI applications, you might consider "winbatch" instead of > Tcl/Expect. If I'm not mistaken, I think HT uses VBA for scripting and possibly might be externally controlled with COM (then tcom could be used). But do check to see if it works. - -- David Gravereaux <davygrvy(a)pobox.com> [species:human; planet:earth,milkyway(western spiral arm),alpha sector] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) iD8DBQFFgeeMlZadkQh/RmERAgxDAKCf+odN2o9puW+90nAW+0sN8dON3wCgqaC9 GFeLpi11RUYoIs1V7m0v2Ms= =oSsh -----END PGP SIGNATURE-----
|
Pages: 1 Prev: transparency Next: oratcl and 10g |