WinSCP scripting

Doug Easterbrook doug at
Thu Oct 28 21:11:41 UTC 2021

hi Greg.

here you go - -the genesis of what you want.  from our backupTM.bat postgres backups script.

 the gist:
echo all the stuff you need into a file to make ascript
run the script using winscp

the key line that goes into the script

echo open ftpes://%FTPUsername%:%FTPPassword%@%FTPSERVER%/ -passive=1 > %FTPscript%

and all %xxxx% variables are windows bat file variables

rem Option #2: use *ENCRYPTED* FTPS the file to the appropriate place
rem            Requires installing WinSCP and connecting to an FTP server that is capable of doing secure FTP (like AMS Cloud backups)

	echo FTP file using winsSCP to %FTPSERVER% - sending %BACKUP_PATH%\%DATABASE_NAME%_TM_%datestr%.backup
	set FTPscript=%BACKUP_PATH%\ftpscript.txt

	echo open ftpes://%FTPUsername%:%FTPPassword%@%FTPSERVER%/ -passive=1 > %FTPscript%
	echo put "%BACKUP_PATH%\%DATABASE_NAME%_TM_%datestr%.backup" %FTPFolder% >> %FTPscript%
	echo exit >> %FTPscript%

	%BOXOFFICE_DIR%\WinSCP /script=%ftpscript% /log=%BACKUP_PATH%\transfer.log
	del  "%BACKUP_PATH%\ftpscript.txt"

Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at
Phone (403) 650-1978

> On October 28, 2021, at 1:30 PM, Grzegorz (Greg) Pasternak <gpasternak at> wrote:
> I use script file for SFTP using WinSCP in batch mode from Omnis.
> I have problem making connection with one of the SFTP sites.
> WinSCP makes connection when open "by hand" in this case, the Advanced Site Settings under SSH/Authentication has option "Respond with a password to the first prompt" checked.
> Does anybody know how can I script this particular option?
> Greg
> _____________________________________________________________
> Manage your list subscriptions at
> Start a new message -> mailto:omnisdev-en at 

More information about the omnisdev-en mailing list