Blog Post

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

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating