#16
|
|||
|
|||
I can explain this in more detail.
strResult = crt.Screen.ReadString(vbcrlf)Your line of code above tells ReadString() to start capturing data until it finds a carriage return and a line feed. When ReadString() finds this set of characters, it returns the data captured in the form of a variable named strResult. Jake indicated that you need to modify the line above to look for your shell prompt rather than a carriage return and a line feed. For example, if your prompt is my_prompt$, you would modify your line of code as follows: strResult = crt.Screen.ReadString("my_prompt$")Making this modification will tell ReadString() to capture date until it finds the string my_prompt$ at which time it will return the captured data in the form of the variable strResult. |
#17
|
|||
|
|||
Quote:
The reason I asked for the detailed explanation is because I tried what you suggested above, but it didn't work. I tried it again now, but it still doesn't work. Any good way to troubleshoot this? |
#18
|
|||
|
|||
It isn't clear how "it didn't work".
Are you stating that strResult is still empty? If so, you might consider recording a script in SecureCRT. A SecureCRT recorded script in conjunction with a raw log can help as you debug your script code. When using a recorded script, a key point to compare is the prompt that is recorded vs. the prompt you have in your script code. Last edited by rtb; 01-19-2016 at 01:01 PM. |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|