Topic "scripting copy help"

Author Message
illic1t

Guest


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?

Code:
"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"


Code:
< 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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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

Guest


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
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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.
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