3
Talk to the guys, baby?
I’m venturing to create myself a backup tool for an FTP, and I’m using Winscp to connect and use the Synchronize command for me.
set FTPSERVER=MEUHOST
set FTPUSER=USUARIO
set FTPPASS=SENHA
set LOCALE=C:\arquivos
set FTPREMOTO=\backup
"F:\Programas\WinSCP\winscp.com" /command "open ftp://%FTPUSER%:%FTPPASS%@%FTPSERVER%/" ^
"synchronize remote ""%LOCALE%"" ""%FTPREMOTO%"" " ^
exit
Good so far connects and makes the copy very neat.
But it just copies the files inside C:\arquivos
straight to the pulp backup
, and does not create the folder arquivos
. I could manually create this folder and play there. But this function that I am doing will be fed later with several other folders, then having to keep creating one by one does not pay off.
Is there any way, when sending to FTP, to consider the parent folder? As if it were a command cd..
and capture that briefcase?
So on my host would stay backup\arquivos
You could bring along to your code an explanation about it?
– RXSD
@Andréfilipe I would like to, but unfortuntely, I do not Speak English. -- Anyway, the point of my Answer is to create the subfolder (
mkdir
), but Prevent failing in case the subfolder exists already (option batch continue
).– Martin Prikryl
It worked as needed. Now with some folders can’t make it work, but its Most likely been a problem with the Quotes escapes. But the code with
batch continue
worked Perfectly. (Worked as needed. Now some folders can not work, but it is likely that it is because of the quotes that need to escape correctly. But the code withbatch continue
worked perfectly– Rafael