Downloading files from different directories

Advertisement

gculbert70@gmail.com
Joined:
Posts:
4
Location:
Phoenix AZ

Downloading files from different directories

Hello I am using the following script to download csv files from different directories on our sftp server to the same local directories. This works for the first three but then errors out on the last one for back orders. I am sure I have not structured something correctly here.
@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\logs\WinSCP.log" /ini=nul ^
  /command ^
    "open sftp://tcvsftpstorageeastus2.ID:PW@tcvsftpstorageeastus2.blob.core.windows.net/ -hostkey=""ecdsa-sha2-nistp256 256 etc""" ^
    "get -latest /emeacrm/orders/*.csv C:\TEImport_Data\orders\" ^
   "get -latest /emeacrm/customers/*.csv C:\TEImport_Data\customers\" ^
"get -latest /emeacrm/materials/*.csv C:\TEImport_Data\materials\" 
"get -latest /emeacrm/backorders/*.csv C:\TEImport_Data\backorders\" 
    "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum