bendataclear
bendataclear

Reputation: 3850

Delete from a remote FTP site using PASV from the command line

I have a program that can launch batch files (.bat) and I need to write a batch file to delete all files from an FTP directory.

My first try was the windows ftp command line program, batch file was:

ftp -i -s:ftpscript.txt

With the script being:

open ftp.hostname.com
myusername
mypassword
quote pasv
binary
cd In
mdelete *.txt
quit

After trying this for a while I found the ftp program doesn't support passive mode... great!

Next I tried ncftp but I can't find any commands that can delete without downloading files.

Question

Is there any way to either:

get ftp windows command working under passive mode? make ncftp delete all remote files in a directory? use any other command line program (in windows) which will support passive mode and delete an entire directory?

Upvotes: 0

Views: 574

Answers (1)

bendataclear
bendataclear

Reputation: 3850

Found another utility which worked perfectly WinSCP.

Also referenced this script:

WinSCP command-line passive mode

Upvotes: 0

Related Questions