ftp commands from batch script

This article explained how to automate the ftp activities from batch file. It will helps to automated file moving process. This example batch file is for upload backup files to ftp server. Here we used an additional configuration file ( ftp.cfg ) for FTP commands. Configuration file should be in the same directory of batch file, or specify the path in the batch file. All ftp commands should specify in this ftp.cfg file. You can use any file name, only thing it should be specified in the batch file.

Usage :

-s:filename Specifies a text file containing FTP commands; the commands will automatically run after FTP starts.

hash command will help to display the progress of file movements

 

Server IP : 192.168.0.1

Sample.bat

@echo off
ftp -v -n -s:ftp.cfg

ftp.cfg

open 192.168.0.1
Username
Password
binary
hash
prompt
mput filename.zip
bye

About Albin Sebastian

I am a Technology Blogger, System Administrator by profession and webmaster by passion. Technology blogger, Active in Online and offline tech communities.

Check Also

Batch Script to check DNS

Batch Script to check DNS results from different DNS Servers

Normal DNS propogation maximum time is 24 hr to 48 hrs. but usually servers start …

Comments