Oh, sorry, I didn’t see your reply…
So sure, I can elaborate more on what I was doing.
Well, the code itself may be beyond the scope of this forum. (I don’t want to bore anyone.) If you’re interested, SSH.NET is an open source C# library. You can get its source code. See link in my original post. And as for how this can be used for an SFTP connection/download script, then here’s a good couple examples on Stackoverflow. I used something very similar to that.
As for my own script that I wrote, it turns out that adding a plaintext password as a Windows command line parameter is not a good idea. Windows treats some characters as escape sequence, or something of that nature. (This goes back to DOS time, I believe) that can screw things up. In my case my script was accepting an SFTP connection password as a parameter as such:
but that caret symbol, or ^, was a special one for Windows, so for some reason it (or maybe Visual Studio) was either removing it, or adding something else to it, so the password was distorted. And that was the reason I was getting all those errors.
So I was able to correct it in my script by scrambling it & encoding it with base64, which would not contain any illegal characters for a Windows command line.
Lastly if you’re interested here’s the resulting tool I made. (Idk if I can post links here, if not, then remove it.) I called it FtpsTransfer. The premise is that it can download or upload all your files, securely via SSH or ftps, in one command line call. Which is good for weekly backups, or when you move your files from one webhost to another. It also makes downloaded files compatible with Windows file system. For instance, Windows is not case sensitive, when Linux is. Additionally, if you have two directories, say “Pay” and “pay” in one directory in your Linux file system, Windows won’t be able to handle them, so if you connect via any FTP client and download those into one folder, Windows will either overwrite one on top of another or will somehow else butcher it up. I couldn’t find any software that will handle this situation, thus I had to write my own tool. So if anyone else wants to use it too, you’re more than welcome.