Home » CodeProject » How to move file through FTP by CMD ?

How to move file through FTP by CMD ?


CMD code to upload file direct into root of FTP site of server

@ echo off

REM ******** this batch file is to upload file

echo user username> ftpcmd.dat

echo password>> ftpcmd.dat

echo bin>> ftpcmd.dat

echo lcd D:\Filelocation>>ftpcmd.dat

echo put filename.csv>> ftpcmd.dat

echo quit>> ftpcmd.dat

ftp -n -s:ftpcmd.dat 172.xx.xx.xxx

del ftpcmd.dat

CMD code to upload file direct into sub directory of FTP site of server

@ echo off

REM ******** this batch file is to upload file

echo user username> ftpcmd.dat

echo password>> ftpcmd.dat

echo bin>> ftpcmd.dat

echo lcd D:\Filelocation>>ftpcmd.dat

echo put filename.csv .\Subdirectory\ filename.csv >> ftpcmd.dat

echo quit>> ftpcmd.dat

ftp -n -s:ftpcmd.dat 172.xx.xx.xxx

del ftpcmd.dat

Reference : Rohit Garg (http://mssqlfun.com/)

Advertisements

3 Comments

  1. lista de email says:

    i read a lot of posts today and yours is the best one i have read ever. i appreciate your attitude.

  2. lista de email says:

    nice article. i am a huge fan of your work and i’m always coming here to see what’s new. thanks.

  3. mestreseo says:

    i loved reading this article.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: