scripting copy help

Advertisement

illic1t
Guest

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

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?

Reply with quote

illic1t
Guest

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.

Reply with quote

martin
Site Admin
martin avatar

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.

Reply with quote

Advertisement

You can post new topics in this forum