Topic "The get command fails if destination directory does not exist"

Author Message
alrisk

Guest


Hello.

The download via get command fails if destination directory (in my case on Windows) does not exist yet.
If I create destination directory by hand then download works just fine.
How can I make it work?

------------- DownloadWholeDirectoryScript.txt -------------
Code:
open sftp://someUser:somePassword;@someHost -hostKey="ssh-rsa 2048 x:x:x:x:x:x:x:x:x:x:x:x:x:x:x:x"
get /foo/bar/* C:\someDirectory\
exit


------------- Console lauched as administrator -------------
Code:
cd C:\Program Files (x86)\WinSCP
C:\Program Files (x86)\WinSCP> winscp.com /ini=nul /script=C:\DownloadWholeDirectoryScript.txt
  Searching for host...
  Connecting to host...
  Authenticating...
  Using username "someUser".
  Authenticating with pre-entered password.
  Authenticated.
  Starting the session...
  Session started.
  Active session: [1] someUser@someHost
  Can't create file 'C:\someDirectory\someFile.txt'.
  System Error.  Code: 3.
  The system cannot find the specified path
  (A)bort, (R)etry, (S)kip, Ski(p) all: Abort
C:\Program Files (x86)\WinSCP>
[/b]
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26705
Location: Prague, Czechia
Yes, the destination directory have to exists. That's it.
You can, of course, use mkdir Windows command from a wrapping batch file, to create the directory, before starting WinSCP script.
Advertisements

You can post new topics in this forum

Search

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