Topic "Delete remote folders\files"

Author Message



I'm trying to download from FTP site to a local path all folders and files and then delete all, but I don't know how do to delete remote folders. I'm using the next command:

synchronize local "C:\temp"
rm *.*
rmdir * '<< Incorret command

This script fails because says it can delete folders (obviusly). Can I use rmdir to delete all folders?
How I can delete all of them?

Thanks a lot,

Best regards
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
Location: Prague, Czechia
There's no command to delete all folders. The rmdir command does not accept file masks.
You can list the folders and remove them one by one.
For that, easier than using scripting interface directly would be to use WinSCP .NET assembly:
Martin Prikryl

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License