Topic "Use a batch file to upen multiple servers and copy files from each"

Author Message
Guest




Hi, I am new to WinSCP and scripting and Batch files so please bare with me.

I managed to get a batch file working to connect to a device with ftp service and download a folder as follows;
Code:

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
   /command ^
    "open ftp://username:password@10.203.61.100/" ^
    "cd /ffs0/niagara/stations" ^
    "lcd ""C:\TONN Backups""" ^
    "get "this folder"" ^
    "exit"

That all works fine. now I want the batch file to move on to another server on the same network and carry out the same process so I tried this;

Code:

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
   /command ^
    "open ftp://username:password@10.203.61.100/" ^
    "cd /ffs0/niagara/stations" ^
    "lcd ""C:\TONN Backups""" ^
    "get "KPMG_15CSQ_L13_DVD_N"" ^
 
    "open ftp://tridium:p1ll1nger@10.203.63.240/" ^
    "cd /ffs0/niagara/stations" ^
    "lcd ""C:\TONN Backups""" ^
    "get "this folder"" ^
    "exit"

and this didn't work.

could anyone point me in the right direction please.

I have about 90 servers dotted around the UK I want to take back up copies of a folder from and would like to use windows scheduler and a batch file to do this automatically once a month.

any help greatly appreciated.

Mark
Code:
Mark_D
[View user's profile]

Joined: 2016-10-27
Posts: 4
Location: London, England
Anonymous wrote:
Hi, I am new to WinSCP and scripting and Batch files so please bare with me.

I managed to get a batch file working to connect to a device with ftp service and download a folder as follows;
Code:

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
   /command ^
    "open ftp://username:password@10.203.61.100/" ^
    "cd /ffs0/niagara/stations" ^
    "lcd ""C:\TONN Backups""" ^
    "get "this folder"" ^
    "exit"

That all works fine. now I want the batch file to move on to another server on the same network and carry out the same process so I tried this;

Code:

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
   /command ^
    "open ftp://username:password@10.203.61.100/" ^
    "cd /ffs0/niagara/stations" ^
    "lcd ""C:\TONN Backups""" ^
    "get "KPMG_15CSQ_L13_DVD_N"" ^
 
    "open ftp://tridium:p1ll1nger@10.203.63.240/" ^
    "cd /ffs0/niagara/stations" ^
    "lcd ""C:\TONN Backups""" ^
    "get "this folder"" ^
    "exit"

and this didn't work.

could anyone point me in the right direction please.

I have about 90 servers dotted around the UK I want to take back up copies of a folder from and would like to use windows scheduler and a batch file to do this automatically once a month.

any help greatly appreciated.

Mark


The above post is from me, i thought I was logged in when i posted it only to find out it posted as a guest.
Mark_D
[View user's profile]

Joined: 2016-10-27
Posts: 4
Location: London, England
Solved it

It was the line space between to two sets of commands
Advertisements

You can post new topics in this forum






Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License