Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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.
legionnl

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

Re: Privatekey not accessible via Task scheduler

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

Privatekey not accessible via Task scheduler

Goodday,

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

the upload script is quite basic:
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