Re: How to execute commands one by one (General questions)
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:
- How to execute commands one by one - lax4u, 2007-07-03, 00:31
- Re: How to execute commands one by one - wodSupport, 2007-07-03, 01:38
- Re: How to execute commands one by one - lax4u, 2007-07-03, 06:54
- Re: How to execute commands one by one - woddrazen, 2007-07-03, 08:13
- Re: How to execute commands one by one - lax4u, 2007-07-03, 15:27
- Re: How to execute commands one by one - woddrazen, 2007-07-03, 15:53
- Re: How to execute commands one by one - lax4u, 2007-07-03, 15:59
- Re: How to execute commands one by one - wodSupport, 2007-07-03, 16:03
- Re: How to execute commands one by one - lax4u, 2007-07-03, 16:19
- Re: How to execute commands one by one - wodSupport, 2007-07-03, 16:26
- Re: How to execute commands one by one - lax4u, 2007-07-03, 17:10
- Re: How to execute commands one by one - wodSupport, 2007-07-03, 17:41
- Re: How to execute commands one by one - lax4u, 2007-07-03, 17:41
- Re: How to execute commands one by one - wodDamir, 2007-07-03, 17:57
- Re: How to execute commands one by one - lax4u, 2007-07-03, 18:15
- Re: How to execute commands one by one - wodDamir, 2007-07-03, 18:26
- Re: How to execute commands one by one - lax4u, 2007-07-03, 20:56
- Re: How to execute commands one by one - wodDamir, 2007-07-03, 21:10
- Re: How to execute commands one by one - lax4u, 2007-07-03, 20:56
- Re: How to execute commands one by one - wodDamir, 2007-07-03, 18:26
- Re: How to execute commands one by one - lax4u, 2007-07-03, 18:15
- Re: How to execute commands one by one - wodDamir, 2007-07-03, 17:57
- Re: How to execute commands one by one - lax4u, 2007-07-03, 17:41
- Re: How to execute commands one by one - wodSupport, 2007-07-03, 17:41
- Re: How to execute commands one by one - lax4u, 2007-07-03, 17:10
- Re: How to execute commands one by one - wodSupport, 2007-07-03, 16:26
- Re: How to execute commands one by one - lax4u, 2007-07-03, 16:19
- Re: How to execute commands one by one - wodSupport, 2007-07-03, 16:03
- Re: How to execute commands one by one - lax4u, 2007-07-03, 15:59
- Re: How to execute commands one by one - woddrazen, 2007-07-03, 15:53
- Re: How to execute commands one by one - lax4u, 2007-07-03, 15:27
- Re: How to execute commands one by one - woddrazen, 2007-07-03, 08:13
- Re: How to execute commands one by one - lax4u, 2007-07-03, 06:54
- Re: How to execute commands one by one - wodSupport, 2007-07-03, 01:38