Have to questions cause can't find it:
How to check if directory contains anything e.g folder or files, whatever... or is it empty
How to remove an empty directory?
How to remove a directory even if there is content.
For instance for creating directory I am using below function:
Public Sub CreateDirectory(path As String)
If session IsNot Nothing Then
session.CreateDirectory(path)
End If
End Sub
Log file as requested in comment:
> 2015-10-05 11:11:13.010 MLST /\MainFolder 2014\ANIA
< 2015-10-05 11:11:13.104 550 MLST command failed: No such file or directory.
. 2015-10-05 11:11:13.104 Could not retrieve file information
< 2015-10-05 11:11:13.104 Script: Can't get attributes of file '\MainFolder 2014\ANIA'.
< 2015-10-05 11:11:13.104 Script: Could not retrieve file information
< 2015-10-05 11:11:13.104 MLST command failed: No such file or directory.
. 2015-10-05 11:11:13.104 Script: Failed