CMD Confirm. Prompt Issue When Connecting to FTP (explicit) With a IP address for the Hostname.
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
I am quite new to FTP's and batch files so any advise would be greatly appreciated.
I've also tried to enter
echo y
or 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.
@echo off "C:\Program Files (x86)\WinSCP\WinSCP.com" ^ /log="C:\folder\Program\WinSCP_program_PUSH_PULL.log" /ini=nul ^ /command ^ "open ftpes://USER:PASS@***.***.***.***/ -certificate=""**:**:**:**:**:**:**:**:""" ^ "cd Folder" ^ "cd Subfolder" ^ "get *.* -delete c:\Folder\Subfolder\" ^ "cd .." ^ "cd Subfolder2" ^ "lcd c:\Folder2\Subfolder2" ^ "put * -delete" ^ "exit" set WINSCP_RESULT=%ERRORLEVEL% if %WINSCP_RESULT% equ 0 ( echo Success ) else ( echo Error ) rem move /Y c:\Folder\Subfolder\*.* \\***.***.***.***\subfolder\ rem --Upload photos exit /b %WINSCP_RESULT%