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

martin

Re: Problems with WinSCP Batch on a Specific Server

Replace the winscp.exe with winscp.com 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 ftp://username:password@url.com" "put C:\*.txt" "cd /Test/" "exit"
user5000

Problems with WinSCP Batch on a Specific Server

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 ftp://username:password@url.com" "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 ftp://username:password@url.com" "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).