How to send files using Windows FTP using task scheduler

Hello, everyone.

In this post, I will try to save all the steps that I’ve used to transfer some files to a third party company from one of my clients.

It is a not so usual type of file transferring action as I used to do because 99% of my clients use Linux instead of Windows on their servers.

It’s quite easy to reproduce for much needs so this article will be very short.

Firstly you will need to create a .bat file. I prefer to create all at the same place and navigate into the directories inside the file, but you can place it where the file is, of course.

Edit the .bat file and write the commands as below, if you will use the native ftp client from Windows:

cd c:\folder
@echo off <-- Not use this line while testing 
echo user ftpuser> ftpcmd.dat
echo password>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo put file1.ext>> ftpcmd.dat
echo put file2.ext>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -d -n -s:ftpcmd.dat ftp.example.com
del ftpcmd.dat

You can use the FTPS solution from MOVEit Freely , it’s pretty much the same:

cd c:\folder
echo off 
echo bin> ftpcmd.dat
echo put file1.ext>> ftpcmd.dat
echo put file2.ext>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftps ftp.example.com -a -user:ftpuser -password:password -s:ftpcmd.dat 
del ftpcmd.dat

That’s being done, let’s put it to send every day by the Windows Task Scheduler, by creating a basic task.

Until the next!

Advertisements

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s