Post a reply

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)


Topic review


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 -------------------------------------------------------------------
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
# Connect
cd outbound
get BANKFILE* C:\bank\in\

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\" ^
/log="D:\WinscpLogs\ftplogs.log" /ini=nul ^
/command ^
"open ftpes://"^
"get BANKFILE* C:\bank\in\" ^

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?