I used psftp as – wqw (Mar 11 at 13:53) suggested on his comment. Here is my new code.
This is my script file
cd to_remotedir
lcd C:\path2 'local dir
mget * *
quit
result = ChangeFileContent("*", xOnlyFileName) //here I change the content of my script file psftpcommand.bat to get a specific file
Sleep 1000
Shell "C:/path/psftp.exe -v -pw " & xPassword & " " & xUserName & "@" & xURL & ":22 -b C:/path/psftpcommands.bat"
Sleep 1000
result = ChangeFileContent(xOnlyFileName, "*")//here I rechanged the content of the file. Change file name to ->*
'In the below I check if the requested file has come
Sleep 1000
If Dir("C:\path2\" & xOnlyFileName) <> "" Then
gLogonFtp = "Successful"
frmDataTransfers.lblTransferInfoDownLoad.Caption = "Dosya Çekildi " & xOnlyFileName
frmDataTransfers.lblTransferInfoDownLoad.Refresh
End If
That's all.
Thank you for your help.
Ferda