I'm trying to and then upload a new one.
I'm using "call cp ..." for backup since I don't find any native winscp command for copying a file.
The problem is after that call the program turns into "winscp>" mode and the rest of the commands don't execute.
I need to input "exit" manually to exit this state but the rest of winscp commands still won't execute.
How can I make the script work in a whole?
My batch code is:
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\php\_WinSCP.log" /ini=nul ^
/command ^
"open (...)" ^
"call cp /path/thefile.txt /path2/thefile%dzisiaj%.txt"
"cd /media/baza/data/ordynator" ^
"lcd C:\Users\jzbudniewek\Documents\produkcja\" ^
"put thefile.txt" ^
"exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
pause