Running script from scheduled task

Advertisement

Guest

Running script from scheduled task

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:
"\\computername\drivename\WinSCPfolder\WinSCP.exe" /console /script="\\computername\drivename\WinSCPfolder\WinSCPscript.txt"

WinSCPscript.txt contains following:
# 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]

Reply with quote

Advertisement

sumdumgai
Joined:
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.

Reply with quote

Advertisement

You can post new topics in this forum