Hello all, I am having some issues while trying to automate a batch file to connect to a FTP (explicit). The issue seems to steam from the Certificate being self-signed and the hostname being a IP address. I ran the program manually and entered (Y) to trust the certificate multiple times but no luck.
I've also tried to enter
echo y | [command]
in multiple places on the batch file, but no luck as well. I think Windows might be forcing the user to give input instead of taking commands from the batch file.
I am quite new to FTP's and batch files so any advise would be greatly appreciated.
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\folder\Program\WinSCP_program_PUSH_PULL.log" /ini=nul ^
"open ftpes://USER:PASS@***.***.***.***/ -certificate=""**:**:**:**:**:**:**:**:""" ^
"cd Folder" ^
"cd Subfolder" ^
"get *.* -delete c:\Folder\Subfolder\" ^
"cd .." ^
"cd Subfolder2" ^
"lcd c:\Folder2\Subfolder2" ^
"put * -delete" ^
if %WINSCP_RESULT% equ 0 (
) else (
rem move /Y c:\Folder\Subfolder\*.* \\***.***.***.***\subfolder\
rem --Upload photos
exit /b %WINSCP_RESULT%