Topic "Problems with WinSCP Batch on a Specific Server"

Author Message


I have tried uploading files from two different servers (Server A and Server B) to an FTP server using WinSCP. To do this, I have manually written out the following single line into the command prompt:

winscp.exe /console /command "option batch abort" "open" "put C:\*.txt cd /Test/" "exit"

From either server, this command works.

Next, I tried turning this single command into a batch program which goes like this (because I want to schedule to command above--which I can do with a batch program and the Windows Task Scheduler):

cd "C:\Program Files (x86)\WinSCP"
winscp.exe /console /command "option batch abort" "open" "put C:\*.txt cd /Test/" "exit"

When run manually (I have not attempted scheduling the batch yet), in the case of Server A, this batch executes, but in the case of Server B, it does not.

What types of settings/configurations should I be reviewing and tweaking on Server B to make the batch program run? Also, should I try something else in the "option batch xxx" part? I tried all four available combinations (on, off, abort, continue) but had the same results each time.

Also note, I tried generating a log, but no log is generated in the case of Server B, which would indicate to me that the entire batch is simply failing (as opposed to other possibilities, such as a typo in the URL or some other networking problem).
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
Replace the winscp.exe with and check what output you see in the console windows.

You are also apparently missing quotes in the command:
winscp.exe /console /command "option batch abort" "open" "put C:\*.txt" "cd /Test/" "exit"
Martin Prikryl

You can post new topics in this forum

Search Site

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License