Topic "Privatekey not accessible via Task scheduler"

Author Message
legionnl

Guest


Goodday,

i have a batch file with a script in it using WINSCP 5.7.5.

the upload script is quite basic:
Code:
open sftp://username@servername:2222 -privatekey=Privatekey.ppk -passphrase=@password
lcd E:\Projectdata\projectname\Export\Processed\

put *.txt

exit


if i activate the batch file with the serviceaccount used by task scheduler there is no problem.
howeever if i activate it via taskscheduler i get the following error in the log file

. 2015-10-08 14:01:20.669 Reading private key file "Privatekey.ppk"
. 2015-10-08 14:01:20.669 Unable to use this key file (unable to open file)
! 2015-10-08 14:01:20.669 Unable to use key file "Privatekey.ppk" (unable to open file)
! 2015-10-08 14:01:20.669 Using username "username".
. 2015-10-08 14:01:20.810 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2015-10-08 14:01:30.841 Disconnected: Unable to authenticate

Any help would be appreciated,
Legionnl
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
I assume the startup directory of the batch file is different to the directory the private key file is contained in. Use a full path to the private key.
legionnl

Guest


unfortunately no. all files are in the same folder. Batch file, scriptfile,scriptlog and Privatekey.

however it was the solution to this problem thank you very much.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
legionnl wrote:
unfortunately no. all files are in the same folder. Batch file, scriptfile,scriptlog and Privatekey.

That does not contradict my claim that the startup directory of the script is different.
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