Monday, March 29, 2010

Automating FTP in windows

Here is a way to automate file upload using FTP in windows. Make a bat file called fileup.bat

@echo off
echo user MyUserName> ftpcmd.dat
echo MyPassword>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo put %1>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat SERVERNAME.COM
del ftpcmd.dat

You can now run this using below command

fileup FileToUpload.zip

No comments: