Topic "Delete remote folders\files"

Author Message
Quim

Guest


Hi,

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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
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:
https://winscp.net/eng/docs/library
_________________
Martin Prikryl
Advertisements

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License