I found some posts on similar issues but I did not make my problem to work. I want to use Windows Task on Windows Server 2012 to copy the content of some folders to back them up on a FTP server.
I created a filebakup.bat
and entered these lines
@echo off
echo user myusername> ftpcmd.dat
echo mypassword>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo lcd /D "G:\Navi_Touren\Tour_2015\">> ftpcmd.dat *the local dir with many files to transfer
echo cd /backups/Tour_2015>> ftpcmd.dat *the Destination Folder on ftp
echo put *>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat myFTPserver.com
It does not work, it says "cannot open file" or similar error message.
I can only make it with one file
echo put "G:\Navi_Touren\Tour_2015\myfile.txt" "/backups/Navi Touren/myfile.txt">> ftpcmd.dat
But how to transfer all files in a certain directory?
Thanks Michael