Hello,
*.lnk files are in fact "normal" files which are treated in a special way by Windows applications. The structure of the file contains information about the Windows shortcut.
It depends on the SFTP server, whether it will actually treat the *.lnk file as a link or simply as a file (the latter is much more probable).
Even testing a Windows based SFTP server (Bitvise) - we can see that Bitvise does not "understand" .lnk shortcuts and simply treats the .lnk as a file. And for SFTP servers running on Unix systems the *.lnk does not have a meaning.
So if you want to download the *.lnk file as a file, it should be enough to write:
Using sftp As New Rebex.Net.Sftp
' connect to a server
sftp.Connect(hostname)
' authenticate
sftp.Login(username, password)
' download a file
sftp.Download("/MyData/shortcut.lnk", "C:\MyData")
' disconnect (not required, but polite)
sftp.Disconnect()
End Using
However if you want to download the file to which the Windows shortcut points, you would have to write a *.lnk parser of your own, find what is the item to which the shortcut points, and then download the linked file using the code above.