Xshell Forum

WaitForString didn't wait forever

Last post: Monday, October 26, 2015 4:57 PM by Support, 1 reply

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

WaitForString didn't wait forever

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.


Program Ver. : Xshell 5
Monday, October 26, 2015 4:57 PM - Support

Re: WaitForString didn't wait forever


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.

Thank you!

Technical Support

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