VanDyke Software Forums

VanDyke Software Forums (
-   General (
-   -   SFXCL Batch file issues. (

JayCee 06-04-2015 06:39 PM

SFXCL Batch file issues.
Hey all, I'm not a big scripter and this got thrown in my lap!
I need to automate FTP job using SFXCL and am using the "Upload .CSV file" example batch file provided in your automation tips pdf file shown below...

I have replaced C:\Out\*.CSV with the UNC path to my source file...

and have replaced sftp://user:pass@ with....
sftp://myusername:mypwd@IP of my companies SFTP site/Home/MyFolder

when running my batch file the log always shows it connected for 21 seconds then changes from a Non connected state to a closed state with 0bytes transmitted. Can someone help me figure out what I'm missing here? MUCH APPRECIATED!!!!

@echo off
for /f "tokens=2-4 delims=/ " %%a in ('date /T') do set MyDate=%%c%%a%%b
for /f "tokens=1-4 delims=:. " %%a in ("%TIME%") do set MyTime=%%a%%b%%c.%%d
set LOGFILE=C:\Temp\SFXCL_LOG__%MyDate%%MyTime%.txt
:: Run SFXCL - upload .CSV files from local "Out" to remote "In" folder:
SFXCL /NOPROMPT /RETRYCOUNT 0 /LOG "%LOGFILE%" \\Myserver\Share\Filetobeuploaded.csv sftp://xxxx:xxxx@
:: Check for failure
if not %errorlevel%==0 goto FAILURE
:: Otherwise... Success!
echo. Transfer Failure. See %LOGFILE% for details.
goto END
echo. Transfer Success.
goto END
echo. Batch file exiting

rtb 06-05-2015 08:06 AM

Hi JayCee,

Thanks for the post. This sounds like a firewall may be blocking the connection. There may also be no direct network path between the machine where SecureFX is installed and the remote machine that has the SFTP server.

Can you confirm that the SFXCL command you are using works from CMD rather than in a batch file?

What version of SecureFX are you using?

What version of Windows are you using?

All times are GMT -6. The time now is 04:36 PM.