Topic "Automate script without storing password in parameters"

Author Message
zfozz
[View user's profile]

Joined: 2009-04-27
Posts: 5
Location: Ohio, United States
I am trying to automate (scheduled daily) a simple script to download some files from my FTP to my computer using SFTP. I have a stored session that I can use to connect manually successfully. I've managed to create the script and it functions properly when I run it. See below:

Code:

option batch on
option confirm off
open user:password@site.org
cd /mydirectory
option transfer binary
get file.txt c:\
close


I would like to avoid having to put my plain text password right in the script. Is there a way to recall my stored session with my saved password in it instead?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
zfozz wrote:
Is there a way to recall my stored session with my saved password in it instead?

Sure, "open stored_session_name". Please read documentation.
_________________
Martin Prikryl
zfozz
[View user's profile]

Joined: 2009-04-27
Posts: 5
Location: Ohio, United States
Thanks. I saw that in the documentation, but I was typing the name of the stored session incorrectly. I was simply putting:

Code:

open site.org


It was prompting me for my user name. I should have been putting:

Code:

open username@ftp:/site.org


Thanks for your help!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
That does not make any sense.
You simply put there name of your stored session as is. "username@ftp:/site.org" looks like a nonsense. Of course unless your stored session has such name indeed.
_________________
Martin Prikryl
zfozz
[View user's profile]

Joined: 2009-04-27
Posts: 5
Location: Ohio, United States
I'm not sure why I have to type all of that. All I know is that it works. I emailed you a screen shot of my Login setup, if you care to look.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
I haven't received anything.
_________________
Martin Prikryl
zfozz
[View user's profile]

Joined: 2009-04-27
Posts: 5
Location: Ohio, United States
I sent it to winscp zero nine at prikryl dot cz. 5/5/09 9:16 AM EST. Subject is "WinSCP Weird Login Name Screenshot".

I just resent it with the same subject name. It has a .jpg attached (screen shot).
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
All I can see on the screenshot is that you've made folder for sessions with name "xxxx@ftp:". I guess you've did it by mistake by naming your session "xxxx@ftp://domain.xx". WinSCP interprets the slash as folder separator, creating the folder implicitly. Though naming the session is completely free. Of course by naming the session as you did, you only make your life more complicated Smile
_________________
Martin Prikryl
zfozz
[View user's profile]

Joined: 2009-04-27
Posts: 5
Location: Ohio, United States
Yes, that makes sense. I seem to be quite adept at making my life more complicated.

Thanks for your help.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License