REM --- ### FTP_Batch ### ---
@echo off
REM获取第一行记录并存储在%% A
中setlocal enableDelayedExpansion
for /F "tokens=*" %%A in (FTP_Account_with_Password_and_EOL.txt) do (
REM使用%% A作为开放连接运行WinSCP
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="c:\temp\WinSCP.log" /loglevel=1 /ini=nul ^
/command ^
"%%A" ^
"ls" ^
"exit"
%WINSCP_RESULT% = %ERRORLEVEL%
if %ERRORLEVEL% neq 0 (
echo Error
echo %ERRORLEVEL% %%A
) else (
echo Success %ERRORLEVEL% %%A
echo Winscp Result %WINSCP_RESULT%
)
pause
)
ENDLOCAL
exit /b %WINSCP_RESULT%