set SCPMAJ_REQ=5 set SCPMIN_REQ=13 %WINSCP% %SCP_PAR% call :check_log for /f "usebackq tokens=6,7 delims=.() " %%a in ( `findstr /c:"WinSCP Version" %SCPLOG%` ) do ( set SCPMAJ_VER=%%a set SCPMIN_VER=%%b ) if /i %SCPMAJ_VER% EQU %SCPMAJ_REQ% if /i %SCPMIN_VER% LSS %SCPMIN_REQ% set BADVER=TRUE if /i %SCPMAJ_VER% LSS %SCPMAJ_REQ% set BADVER=TRUE if defined BADVER ( echo [E] WinSCP is not the correct version. It must be at least %SCPMAJ_REQ%.%SCPMIN_REQ% echo and is actually %SCPMAJ_VER%.%SCPMIN_VER% call :winscp_bad goto :exitlogic ) else ( if /i %DEBUG% GEQ 3 echo [D] WinSCP Version %SCPMAJ_VER%.%SCPMIN_VER% )
Most env vars are self-explanatory. SCP_PAR (for parameters) is, in this case,
I guess the question is, is there a way to get the version number from the command line without going through all this, or, if not, is there a way to get WinSCP to generate a log file without actually opening a connection? I'd like to speed this up...