How to write a batch file for FTP?

Joined
Aug 8, 2006
Messages
58
Reaction score
0
how to write a file that will compress a files in a folder and then will send that compressed file trough FTP software??

@echo off


set /P my_folder="Please enter folder to zip and FTP: "

if exist %my_folder% goto do_zfile
goto error

:do_zfile

cd %my_folder%

rem .: if your date has '/' in the date, they need to be stripped out.
for /f "delims='/'" %%i in ('%date%') do
set my_date=%%i-%%j-%%k

zip_program /switches *.* %my_date%.zip

set /P my_loc="Please enter FTP site: "
set /P my_id="Please enter your ID: "
set /P my_pass="Please enter your Password: "

echo open %my_loc% > ftp_conn.txt
echo user %my_id% %my_pass%>> ftp_conn.txt
echo binary >> ftp_conn.txt
echo hash >> ftp_conn.txt
echo put %my_date%.zip >> ftp_conn.txt
echo close >> ftp_conn.txt
echo quit >> ftp_conn.txt

ftp -s:ftp_conn.txt

del ftp_conn.txt
del %my_date%.zip

goto done

:error
echo Folder was not found.

:done


in that when i'm asked for a folder to zip and ftp i don't know what to write... ???
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
kabucek, please do not make 4 threads on the exact same thing - you haven't even replied to TD on the first one you created.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top