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/)


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

Join us on Facebook

microsoftcommunitycontributor
%d bloggers like this: