Arie
Arie

Reputation: 3573

How to rename directory with WinSCP .NET assembly?

I want to be able to rename directory whether it contains something or not. I do not see such option. For instance this is how I create directory, but how to rename it?:

Public Sub CreateDirectory(path As String)
    If session IsNot Nothing Then
        session.CreateDirectory(path)
    End If
End Sub

Upvotes: 2

Views: 958

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202393

Use the Session.MoveFile method:

session.MoveFile("/path/directory", "/path/new_name")

Upvotes: 2

Related Questions