Not able to transfer file automatically with batch file script

Advertisement

m-sonawane@eisai.co.in
Joined:
Posts:
4

Not able to transfer file automatically with batch file script

Hello,
I am not able to transfer file with batch file script.
Attached is the result. Files are not transferring to the SFTP server after successful connection. Session is closing after active connection.
Script is mentioned below..
@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\Program Files (x86)\WinSCP\logs\AutoTransfer.log" /ini=nul ^
  /command ^
    "open sftp://serverdetails:50022/ -hostkey=""ssh-rsa 2048 *******************""" ^
    "lcd E:\TitanSFTP\Data\server ip address\usr\sftpuser\DSU\DATA\OUT" ^
    "cd /EInvoice" ^
    "put -rawtransfersettings[1] FileNameCase=0 *.* " ^
    "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 
(
 echo Success
)
 else 
(
 echo Error
)
 
exit /b %WINSCP_RESULT%
Please help

batchfile error.jpg

Reply with quote E-mail

Advertisement

m-sonawane@eisai.co.in
Joined:
Posts:
4

@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\Program Files (x86)\WinSCP\logs\AutoTransfer.log" /ini=nul /command ^
"open sftp://serverdetails:50022/ -hostkey=""ssh-rsa 2048 ***************""" ^
"lcd E:\TitanSFTP\Data\IP address\usr\sftpuser\DSU\DATA\OUT" ^
"cd /Einvoice" ^
"put *.* " ^
"exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0
(
echo Success
)
else
(
echo Error
)
 
exit /b %WINSCP_RESULT%
Above is the script and the attached is the error.
I am not able to find the logs on the mentioned address C:\Program Files (x86)\WinSCP\logs\AutoTransfer.log

batchfile error.jpg

Reply with quote E-mail

Advertisement

You can post new topics in this forum