0

I am currently attempting to use FileZilla Pro CLI on a Windows machine to connect and upload to a site in that is working in the Site Manager.

The issue is, the command below works perfectly when pasting it directly into the cmd line. However when saving it as a batch file, it simply just gets to the fzcli> prompt and then nothing happens.

The two line breaks are on purposes to override the requirement for a password and it works perfectly when pasted in.

Does anyone know if this is a cmd line issue, or if my commands need to be different to work in batch file mode?

fzcli
connect --site 0testsite01


put C:/inetpub/wwwroot/websites/sftp/files/customer/test-01.txt /test-sftp/testuser01/test/test-01-uploaded.txt
PAUSE
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992

1 Answers1

0

Your batch file executes fzcli in an interactive mode. The fzcli then waits for you to interactively enter the commands. Only after you would exit the fzcli, the batch file would continue. And fail, as it will try to execute connect as a batch file command. The fzcli does not know about the batch file. Nor does the batch file interpreter know about the fzcli commands.

It's a common misconception. You will find plenty of similar questions basically about scripting any tool that has its own commands. For example: sftp, ftp, psftp, winscp.


To provide commands to fzcli, it seems that you need to use --script switch. The fzcli documentation gives this example:

fzcli --mode standalone --script C:\Scripts\script-file
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992