VanDyke Software Forums

VanDyke Software Forums (
-   Scripting (
-   -   Scripting SecureFX (

matt131 03-23-2005 06:53 AM

Scripting SecureFX
Can you run SecureFX with a script similar to SecureCRT? I'm trying to find a good way to automaticlay move files around and capture the transfer information in logs for review if something goes wrong. Id like to pass all the needed information as parms to the script for connecting and moving the files.

Currently I'm doing this using batch files and OpenSSH. I use the sftp command and pass it a command file that contains the commands I need it to carry out (put, get, ls, cd, etc). This is working fine but I am not able to capture an error condition if the put or get step fails.

Any information would be greatly appreciated.

doucette 03-23-2005 12:25 PM

I second that motion :D

wasodg2 04-05-2005 08:40 AM

You could try the EXEC method from within vbScript, it has the capability to capture output from the command line. Kind of like the following example with the ping command.

StrComputer = "PlaceComputerNameHere"
Set Shell = CreateObject("WScript.Shell")
Set objScriptExec = Shell.Exec("ping -n 1 -l 5 -w 1000 " & strComputer)
Do While Not objscriptexec.Stdout.AtEndOfStream
str = objscriptexec.Stdout.ReadLine
If InStr(str, "timed out") Then
WScript.Echo StrComputer & " not responding"
End If
If InStr(str, "Reply from") Then
WScript.Echo StrComputer & " Computer On Line"
End If

All times are GMT -6. The time now is 01:10 AM.