Post a reply

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

Re: scripting copy help

The dir K: should not fix anything. It was meant just as a test, if the K: drive is available, at the time you run WinSCP.
illic1t

Re: scripting copy help

martin wrote:

How are you running your script?
Are you running it from the same environment and using the same local account that has the drive mapped?
If you do dir K: from the batch file, before running winscp.com, what does it display?


I think this does it. I'm at least getting different errors in the log. By doing dir K:, do I still need "lcd K:" ^ in the batch job?

And yes I am running everything in the same environment using the same local account that has the drive mapped.
martin

Re: scripting copy help

How are you running your script?
Are you running it from the same environment and using the same local account that has the drive mapped?
If you do dir K: from the batch file, before running winscp.com, what does it display?
illic1t

scripting copy help

I am trying to use use winscp to copy files from a share on one server to a ftps.

I'm trying to test this locally first and have mapped the network share to K:

The script fails to change the directory for some reason. Is winscp capable of this?

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^

  /log="C:\Program Files (x86)\WinSCP\log\WinSCP.log" /ini=nul ^
  /command ^
    "open ftps://URL" ^
    "lcd K:" ^
    "cd /" ^
    "put *" ^
    "exit"


< 2016-09-29 16:17:56.528 Script: Error changing directory to 'K:'.

< 2016-09-29 16:17:56.528 System Error.  Code: 3.

< 2016-09-29 16:17:56.528 The system cannot find the path specified
. 2016-09-29 16:17:56.528 Script: Failed
. 2016-09-29 16:17:56.528 Script: Exit code: 1