Topic "Running script from scheduled task"

Author Message
Guest




I've read a number of posts on this subject and read the documentation, but I still don't understand what I have to do to run a script that downloads files from a scheduled task. I understand that running this way means WinSCp is running under a different account and configuration, but I'm not familiar with .ini files, changing configuration storage locations, or making registry changes. Can someone please refer me to a more detailed post, or give me an example, that explains in step by step fashion what I have to do to get WinSCP to run from a scheduled task? I'm certain this can be done easily but I just can't get it to work. Here's the script that works when I'm logged on:

DOS batch file command to launch WinSCP contains following:
Code:

"\\computername\drivename\WinSCPfolder\WinSCP.exe" /console /script="\\computername\drivename\WinSCPfolder\WinSCPscript.txt"


WinSCPscript.txt contains following:
Code:

# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on

# Disable overwrite confirmations that conflict with the previous
option confirm off

# Connect using a userid, password and host
# open user:password@example.com
# Specify SFTP connection
open myuserid:mypassword@sftp.mycompany.com

# Change remote directory
cd /home/sourcefolder
# Force binary mode transfer
option transfer binary

# List files in remote directory example\
#ls

# Download file to the local directory
get *.* -delete "\\computername\drivename\targetfolder\"

# Disconnect
close

# Exit WinSCP
exit



I'd really appreciate some help here as I've been trying to get this to work for a couple of weeks with no progress.

Thanks[/code]
sumdumgai
[View user's profile]

Joined: 2010-05-21
Posts: 8
More info. I produced a log and these entries were there:
[quote]
The server's host key was not found in the cache. You have no guarantee that the server is the computer you think it is.
The server's rsa2 key fingerprint is:
xxxxxxxxxxxxxxxx
If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel.
Continue connecting and add host key to the cache? ()
Attempt to close connection due to fatal exception:
Host key wasn't verified!
Closing connection.
Quote:
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Please read documentation:
http://winscp.net/eng/docs/scripting#hostkey
_________________
Martin Prikryl
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