how to rename/move file on sftp

[code] dim e as integer
dim d as new CURLSMBS

d.OptionURL=“sftp://"
d.OptionVerbose = true
d.OptionDirListOnly = true
d.CollectOutputData = true
d.CollectDebugData = true
d.OptionUsername = "
"
d.OptionPassword = "
*”

dim ws() As String
ws.Append"RNFR file move"
ws.Append"RNTO destination path"

d.SetOptionPostQuote(ws)

e=d.Perform

listbox1.DeleteAllRows
dim s as string = d.DebugData+EndOfLine+d.OutputData
s = ReplaceLineEndings(s, EndOfLine)
dim lines() as string = split(s, EndOfLine)
for each line as string in lines
listbox1.AddRow line
next

listbox1.addrow "Result: "+str(e)
[/code]
I am using sftp server and I want to move file .
when above code is executed ,connected to sftp but it showing Result:21 and uknown sftp command error

RNFR is for FTP. But you use SFTP.
So you need to use other command like “mv”. Same as with terminal.

Thank you for Reply, I got sftp Command for rename/move.
Use below updated code

  dim ws() As String
  ws.Append"rename ***old path***   ***new path****"
  
  d.SetOptionPostQuote(ws)

Need space between old and new path