Xshell Forum

scripts proplem.

Last post: Thursday, October 20, 2011 7:15 PM by howard, 2 reply

Tuesday, October 18, 2011 2:37 AM - howard

scripts proplem.

xsh.Session.Open("/s .\sftp@")
xsh.Screen.WaitForString("Type `help' to browse available commnands.")
xsh.Screen.Send "ls" & chr(13)
xsh.Session.Sleep 500
xsh.Screen.Send "put test.txt" & chr(13)
xsh.Screen.WaitForString("sftp: sent")

I want to open a sftp session, and put test.txt. I want get sftp prompt "sftp: sent", but sometimes i can not get sftp prompt "ftp: sent ...", this line lost, why?

Program Ver. : Xshell 4
Wednesday, October 19, 2011 1:34 AM - Support

Re: scripts proplem.

Please try using the following script. Use the absolute session path.

xsh.Session.Open "/s $FULL_SESSION_PATH$"

xsh.Screen.Synchronous = True

xsh.Screen.WaitForString "Type `help' to browse available commnands."

xsh.Screen.Send "ls"
xsh.Screen.Send VbCr

xsh.Session.Sleep 500

xsh.Screen.Send "put test.txt"
xsh.Screen.Send VbCr
xsh.Screen.WaitForString "sftp: sent"

Technical Support
Thursday, October 20, 2011 7:15 PM - howard

Re: scripts proplem.

thanks, that ok.