Re: How to execute commands one by one - WeOnlyDo Discussion board

Re: How to execute commands one by one (General questions)

by lax4u, Tuesday, July 03, 2007, 06:54 (6354 days ago) @ wodSupport

see when i coonect using windows telnet screen after connecting succussfully i get screen which at the bottom says Press Any Key Continue . So to by pass this screen i have to send enter which is /r/n right? then i get one more screen which has buch of text and also a prompt says Code: and here i have to type 'DTL' and enter. Remeber this is yet not Unix screen. After this i get screen with : , where i have to type sys to goto Unix screen.

so tell me if this is right
Telnet1.Waitfor( press any key to continue );
Telnet1.Execute( \r\n , Code: ,timeout);
Telnet1.Waitfor( Code: );
Telnet1.Execute( DTL , : ,timeout);
Telnet1.Waitfor( : );
Telnet1.Execute( sys , $ ,timeout);
Telnet1.Waitfor( $ );

Laxu,

I would suggest you use WaitFor and Execute methods for that.

You would do something like

Telnet1.Waitfor( press any key to continue );
Telnet1.Execute( ls -al\r\n , regex:[\$ #>] $ );

etc. Just make sure 2nd parameter to Execute call is expected command prompt. Regex match from above should catch most of UNIX prompts.

Hope that helps!

Kreso


Complete thread: