View Single Post
Old 01-19-2016, 10:24 AM
e2script e2script is offline
Registered User
Join Date: Sep 2014
Posts: 34
Originally Posted by rtb View Post
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.
That's actually exactly what I tried out before asking about a more detailed explanation.
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?
Reply With Quote