FTP settings during automated FTP upload

Hi there,
Was wondering if someone can help me out here...
One of our customers changed their FTP application, and as a result, broke our automated process. What was set up to run daily:

@echo off
echo user "username"> ftpcmd.dat
echo "password">> ftpcmd.dat
echo bin>> ftpcmd.dat
echo put %1>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat ftp.site.com
del ftpcmd.dat

Open in new window

Using FileZilla, I managed to troubleshoot some settings: FTP -> Active Mode and Encryption-> Only use plain FTP (insecure)
Once these were set, I was able to connect to the server and manually upload the file.

Is there any way to set these settings in the batch file above? Or would I need to go a different way?

Please let me know if you need additional info/details...

Much appreciated,
Classic1Database AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
Do you have to use FileZilla?  The prior approach was using the standard FTP client that is part of Windows, and that should still be on that computer as well.  The two programs can peacefully co-exist...  As it stands your script should still run, and use the default windows FTP client, or is that not the case?

(from the "if it isn't broke don't fix it department")

Classic1Database AdministratorAuthor Commented:
Hi Bill,
Thanks for the quick reply!
So the customer moved from FileZilla to an external crushftp site over the holiday break (which we were the last to know...LOL). I don't know if it actually configured properly, but on my own computer (FileZilla), I had to play around with the site settings, in order to connect/upload files successfully. I thought I could 'mimic' the settings within the batch file somehow...

The batch file is on one of our Windows Server and was running fine until their application change...

Much appreciated,
Bill PrewIT / Software Engineering ConsultantCommented:
Oh, I get it better now, I misunderstood a bit before.

So the host server that you upload to  changed their FTP software, and now the prior BAT script that you were using doesn't work.  That's not too surprising, it is a pretty bare bones FTP client.

Do you know what the settings were you had to tweak?  Active versus passive xfer?  Or security related (requiring SFTP or FTPS)?

Depending on the requirements of the new FTP site that will determine of the Windows client can be made to work, or if you need to look elsewhere.  FileZilla is okay for interactive work, but doesn't support any scripting as far as I know.  But you could look at something like WinSCP or maybe even one of my favorite ways to do simple FTP xfers from a command line, NCFTP.

CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Classic1Database AdministratorAuthor Commented:
Hi Bill,
Yup, using FileZilla, the settings (for the customer's site) that I changed were:

Transfer mode: Active
Protocol: FTPSetting I had to changeEncryption: Only use plain FTP (insecure)
Setting I had to change
I'll take a look at NCFTP, and see if that does the trick...

Thanks again,
Bill PrewIT / Software Engineering ConsultantCommented:
Well, that in itself should be compatible with baseline Windows FTP, but maybe there is more to it.  Windows FTP supports Active mode, but not Passive.

What errors do you get when manually connecting with Windows FTP?

But NCFTPPUT still worth a look, it's a lot easier to script from BAT / Command Line, and then error check.  If it works with the site involved.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Classic1Database AdministratorAuthor Commented:
Hi Bill,
I've embedded a couple of screenshots of the errors I got using Windows FTP and WinSCP...(it was easier to convert my script to WinSCP). It looks like their server terminates the connection...


Either way, I talked to the customer and they were happy receiving the data via email, so I quickly wrote a PowerShell script and that did the trick...

Thanks a bunch for your comments...

Classic1Database AdministratorAuthor Commented:
Thanks for your help!

Much appreciated,
Bill PrewIT / Software Engineering ConsultantCommented:
Thanks for the feedback and glad you got a solution worked out.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.