1

I'm trying to create a .bat file to delete all XML files on a certain FTP folder regardless of the date of the file. I've tried many scripts without any solution.

Many experts are talking about .txt file containing the below script, but to be quite honest I don't know how to execute it or even am if I am creating the file correctly or not.

All I need is to delete all the files on this container.

open ftp://xxxx.xxxx.net
myusername
mypassword
cd /bts/xxxx
mdelete *
quit
0

1 Answer 1

5

Your FTP script looks ok. You just might want to replace mdelete * with mdelete *.xml, if there are also other files than .xml in the folder.

To actually run the script, run ftp.exe from your batch file like:

@echo off
echo Running FTP to delete XML files...
ftp -s:ftp.txt

where ftp.txt is filename containing your FTP script (the one from your question).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.