WINSCP Batch file error pushing file to SFTP
First - Not a programmer by any means, however, I have been able to grab a file via WINSCP SFTP to a third party server/system. I was then asked to create the same by pushing a file. AS in the working case I created a Batch file to call a text file to pull the file in. after some serious tweaking, I got this to work.
Now in the new scenario, I re-created the same batch/text file and added the needed commands based on what I read and this is creating and error that I cannot resolve. I know the directory has the necessary permissions as I can perform the task manually without issue via WINSCP. I am guessing it is the code - not sure - HELP!
Batch:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@echo off
REM Next line NOT needed if you add the WinSCP folder to your Windows
REM PATH environment variable
CD "C:\Program Files (x86)\WinSCP"
Winscp.com /script=C:\Scripts\SFTP_FILENAME.txt
pause (ADDED FOR TROUBLESHOOTING)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(TEXT FILE BEING CALLED)
option echo off
option batch on
option confirm off
open sftp://USERID:PASSWORD@sftp.COMPANY.com
put -delete -nopreservetime -nopermissions E:\SFTP_Test\*.pdf /*
exit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See attached for error -
Now in the new scenario, I re-created the same batch/text file and added the needed commands based on what I read and this is creating and error that I cannot resolve. I know the directory has the necessary permissions as I can perform the task manually without issue via WINSCP. I am guessing it is the code - not sure - HELP!
Batch:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@echo off
REM Next line NOT needed if you add the WinSCP folder to your Windows
REM PATH environment variable
CD "C:\Program Files (x86)\WinSCP"
Winscp.com /script=C:\Scripts\SFTP_FILENAME.txt
pause (ADDED FOR TROUBLESHOOTING)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(TEXT FILE BEING CALLED)
option echo off
option batch on
option confirm off
open sftp://USERID:PASSWORD@sftp.COMPANY.com
put -delete -nopreservetime -nopermissions E:\SFTP_Test\*.pdf /*
exit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See attached for error -