Dummy needs super explicit one-liner command line command for simple winscp.exe file put over TLS

Advertisement

texas-bronius
Joined:
Posts:
3
Location:
Texas

Dummy needs super explicit one-liner command line command for simple winscp.exe file put over TLS

I couldn't seem to crack it and saw other forum posts with similar questions but no explicit, dummy-proof answers. I needed to see a sample one-liner command with WinSCP.exe (or WinSCP.com?) to simply connect over TLS and put a file. I was awfully confused between /clientcert, /certificate, and I didn't know whether I needed to generate my own certificates or what. Eventually I came across the switch "/explicit" which seems to do it all:

c:\Program Files\WinSCP>WinSCP.exe ftp://USERNAME:PASSWORD@ftp.DOMAIN.com /explicit /upload e:\FILENAME.txt

First time it did prompt me to accept the remote certificate which is cool. I think if I run this one time, I can then run it automated thereafter...

Now I just need to learn how to overcome the "/*.*" name the destination file.. How do I do that?

Thanks!
-Bronius

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,587
Location:
Prague, Czechia

Re: Dummy needs super explicit one-liner command line command for simple winscp.exe file put over TLS

First, do you really want this GUI solution? Maybe you wanted to use scripting.

Anyway, I do not understand what you mean by "overcome the "/*.*" name the destination file".

Reply with quote

texas-bronius
Joined:
Posts:
3
Location:
Texas

Thanks for your speedy reply!

I think definitely not GUI: I want a one-liner command line statement to slip into a
Shell <cmd>
as part of my Microsoft Access automated CSV export and ship to remove mysql server. Having tried a bunch of other things, this was the method I landed on, and ftp.exe which ships with Windows doesn't support TLS.

The "/*.*" refers to a GUI dialog prompt for destination filename that pops up just before the ftp PUT operation when I run the one-line cli command shown earlier:
[img]winscp dialog prompts for file name.jpg[/img]
When I hit Enter (accept the default "/*.*"), the transfer goes through without issue and the specified/desired single file is placed, named as it was on my source client machine running the WinSCP file transfer command. I suspect there is another option to either "don't prompt me" or "destination file should be named XYZ", but I haven't seen it.

Description: WinSCP.exe prompts for destination file name / path

winscp dialog prompts for file name.jpg

Reply with quote

texas-bronius
Joined:
Posts:
3
Location:
Texas

texas-bronius wrote:

Thanks for your speedy reply!
...option to either "don't prompt me" or "destination file should be named XYZ", but I haven't seen it.

Ah ha! There's a
/defaults
cli parameter which does exactly what I was hoping. Note: I did have to run it a couple times and check the "don't show this again" which seems to persist from cmd shell instance to instance. Full, dummy-ready one-liner for WinSCP.exe secure FTP with TLS and username and password authentication follows:

"c:\Program Files\WinSCP\WinSCP.exe" ftp://USERNAME:PASSWORD@THE.DOMAIN.COM /explicit /certificate /upload e:\FILENAME.csv /defaults

Reply with quote

Advertisement

You can post new topics in this forum