Problems with WinSCP Batch on a Specific Server

Advertisement

user5000
Guest

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).

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,506
Location:
Prague, Czechia

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"

Reply with quote

Advertisement

You can post new topics in this forum