View Single Post
  #6  
Old 06-22-2015, 11:28 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi mms,

The issue is not related to escape sequences.

The problem is actually hard to describe.

If you cancel your script when you are testing a Telnet failure, what line is indicated?

My guess would be that the script is stuck waiting for the username prompt on a connection where Telnet is failing.

The basic concept to overcome this is to issue a command, and then wait for all possible responses including success, failure, etc. in a loop handling each possibility as it is received. If you wait for only one possible response, then you loose the possibility of dealing with any other responses. Your script is probably hanging, so you aren't loosing data, but since you are not finding what you need the script is not working.

We have an example that script that illustrates how to handle many possible responses in a loop. Please find it attached.

You will need to modify the example to wait for the responses that you know are possible. That string is on lines 17 to 20. Also, each time you add a possible response, you will have to add a case to the Select statement (beginning on line 40) to deal with the possible response.

Does this help you fix your script?
Attached Files
File Type: txt HandleAuthInTerminalWindow.vbs.txt (4.2 KB, 1076 views)
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote