Delete directory recursively

Advertisement

oli001
Joined:
Posts:
3

Delete directory recursively

Hi,

how can I delete a directory recursively?
with session.executeCommand("RD ....") I cant't delete folders that are not empty.
is the only possibility wirting a recursive function that removes all files and then deleting directories?

Thank you,

Oli

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Delete directory recursively

There's no official way.
Added to tracker:
https://winscp.net/tracker/887

You may achieve that with Session.ExecuteCommand. But the solution is protocol-dependent. I do not know, what protocol you are using. If FTP (seems so from RD command), there's probably no way.

Reply with quote

Advertisement

You can post new topics in this forum