View Single Post
  #2  
Old 11-01-2019, 12:24 PM
berdmann berdmann is offline
VanDyke Technical Support
 
Join Date: Aug 2017
Posts: 319
Hi JoseLuis,

The first troubleshooting step is to determine if Synchronous is true for the Screen object. You can do this by inserting a line similar to the following as the first line of main():
Code:
crt.Dialog.MessageBox("sync: {0}".format(str(crt.Screen.Synchronous)))
If Synchronous is true the next step is to recognize that nothing gets displayed to the screen until a call to ReadString() or WaitFor*() is made. Because of this, the "\r" that you sent prior to the ReadString() call will be echoed by the remote shell, back to SecureCRT, such that it will be included in the data returned by the ReadString() call. In fact, what will be echoed by the remote would most likely be a "\r\n" sequence.

Neither "\r" nor "\n" are characters that will be found in your path or filename, which likely explains the failure that you are experiencing.

To sanitize the hostname that is read in of all of the potential "\r" and "\n" characters, you would want to use something like this once you have read in the hostname:
Code:
hostname = hostname.replace("\r", "")
hostname = hostname.replace("\n", "")
__________________
Thanks,
--Brittney

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