Batch file to copy local folder to FTP server fails with "cannot open file" on "put *" -
i found posts on similar issues did not make problem work. want use windows task on windows server 2012 copy content of folders them on ftp server.
i created filebakup.bat
, 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 many files 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 not work, says "cannot open file" or similar error message.
i can make 1 file
echo put "g:\navi_touren\tour_2015\myfile.txt" "/backups/navi touren/myfile.txt">> ftpcmd.dat
but how transfer files in directory?
thanks michael
you need use mput *
, instead of put
. put
not accept wildcards.
plus want use prompt
disable confirmation of every selected file.
prompt mput *
also there no /d
switch in lcd
command. remove that. , trailing backslash not seem work either.
lcd "g:\navi_touren\tour_2015"
Comments
Post a Comment