WaitForString didn't wait forever [1]

WaitForString didn't wait forever

Friday, October 23, 2015 2:43 AM - justfool

Hi support,

I tested the xshell_screen.vbs in the installed script folder.
It should be wait for input string "aaa" and then execute command "cat /etc/passwd", but it still executed the command even I didn't input anything.

Does the WaitForString() has default waiting time? I can't find the description in the documents.

Thanks.

Program Ver. : Xshell 5


Re: WaitForString didn't wait forever

Monday, October 26, 2015 4:57 PM - Support

Hello,

WaitForString does not have a timeout. However, there does seem to be an issue in the current version. We will confirm and correct the issue as soon as possible.

Instead of using WaitForString, you can try using the WaitForStrings API.

For example,

Dim indexOfStrs, waitStrs
waitStrs = Array("aaa", "bbb")
indexOfStrs = xsh.Screen.WaitForStrings(waitStrs, 0) => 0 means there is no timeout.
xsh.Screen.Send(indexOfStrs)

Thank you!

Technical Support

Like us on Facebook
Follow us on Twitter
Visit our blog Blog


Previous views: 152