FTP Backup Login incorrect WIN 10 batch

Running Duplicati Backup at my home-Network PC → NAS.

Running FTP-Backup from WebBrowser-Frontend completed successfully!

Running > Duplicati.CommandLine.exe" backup “ftp://NASDS118:21//homes/back2?auth-username=back2&auth-password=somepassword” “E:\somedirectory\”
leads to error “Login incorrect”.

I´ve exported the backup configuration as command-line, copied the text into a batch-textfile. Server-path, Port, user-name and password should be correct.

Is there a trick to manage correct Login by Windows batch-script?

Does it run from Command Prompt but not from a batch file? Is there a % around? If so, double to %%.

Script ran from Command Prompt, but password included special character “%”. Masking the “%” by doublig to %% didn´t work - I guess because there were more other special characters like “+” used for the old password. New password exclusively numbers and small letters did the job! Thanks a lot TS678!

you can use a character like % if you either enclose the value in quotes or escape the character.

If I have a directory called “Batch Files”, then
> cd Batch Files
does not work - it looks for a directory called Batch, and fails when that is not found. The space after Batch is interpreted by the command process as a separator between parameters and not just part of the name of the directory. It’s a “special character” in this context.

> cd "Batch Files"
works fine. Quoting the string makes the entire string one parameter, regardless of any special characters inside it.

So does
> cd Batch\ Files
because the \ before the space “escapes” the space and makes it not-special for this one instance of it.

1 Like

Thank you Kahomono! Now I`m beginning to understand - so I wouldn´t had to delete my old password - adding quotes would have made the command processor to handle the password despite of many enclosed special characters.

To learn more about batch-syntax:

  • use quotes when intent to process a complete string ?
  • use % to mask a single special character in an string ?

The link I gave earlier is actually called Escape Characters. It looks like there are others that can bite, however I’m not sure which ones bite in batch files but not directly from Command Prompt. % was one.

Perhaps (if you like), you could work out which other special characters broke only when in a batch file.

One other question is – where did you get the ftp destination URL? I think it’s supposed to be using URL format where special characters get percent encoding. Export As Command-line does that, and quotes.

Obtaining the URL some other way might leave you with special characters that aren’t %, making issues.
I’m still not sure why the issues would show up only in batch files, and not directly at Command Prompt.