Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

tbaldwin

run script that works on one server; doesn't work on another

Have a group of scripts on one server. The version of winscp on that server is 5.7.6.
The FTP site credential is set up in the winscp gui.
There is a batch script that gets called from "control-m" scheduler.
The batch script looks like this and has a switch to call another text file that contains the ftp commands.
----------------------------------------------------------------------------------------------------
rem - run winscp to pull the files from bank FTP server
rem -------------------------------------------------------------------
CD C:\APPS\BANK
rem - the file getbankfile.txt is located in the above directory
C:\"Program Files"\WinSCP\winscp.exe /console /script=GetBankFile.txt
rem -------------------------------------------------------------------
rem - copy the files to the backup folders
xcopy C:\bank\in\bankfile.* \\backups\Banks
-----------------------------------------------------------------------------------------------------

Below is the contents of the getbankfile.txt
# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on
# Connect using a password
# open user:password@example.com
# Connect
open ABC123@ftp.bank.com
binary
cd outbound
get BANKFILE* C:\bank\in\
bye


Now, I copied these files onto a new server, installed winscp version 5.9.1. and tried to run these from the scheduler. They don't work.

If I double click the .bat file directly on that server, it runs.

Additionally, I generated this script on the new server and it came up with the following:
"C:\Program Files\WinSCP\WinSCP.com" ^
/log="D:\WinscpLogs\ftplogs.log" /ini=nul ^
/command ^
"open ftpes://ABC123:Password@ftp.bank.com/"^
"get BANKFILE* C:\bank\in\" ^
"exit"

Called this batch file through the scheduler and it worked. This good that it worked, but I have dozens of ftp scripts that would potentially need converted using this method.

Is there some configuration that I need to set on the new server that would enable me to use the scripts already created in the first example?

Thanks,
-Tim