Thank-you....had been playing with quotes but it was originally giving a 'too many parameters' error - then the confusion was it finally "worked", even with those extra quotes, under my ID - falsity was that (apparently) it was using a key cached in the registry and not the key I was passing to it (unfortunately it never indicated that!?)...set /ini=nul and it started failing on my ID as well ....then was able to fix both with your correction to quotes.
Is there any way to see the indication that it checked the cached key 'under the covers' in case others encounter similar feature?
You have too many quotes there.
It should be:
open %1% -hostkey="%4%"
This works too (but the above is preferred):
open %1% "-hostkey=%4%"
Running WinSCP 5.7.7 on windows 2012 server, SQL 2014 standard and SSDT v12 under MS Visio Studio 2013;
Have an SSIS package using Execute Process task to launch Batch file which launches WinSCP to connect SFTP to server using ID:pwd and hostkey fingerprint validation. When running SSIS package from SSDT and/or SSMS under my ID- all good - see last seesion snipit in attached logfile; however when running same package (eg same batch file and winscp script) under SQL Server Agent Job schedule - it gives error that host key does not match - yet even in log printout the keys are the same (see first snipit in attached file). I'm guessing it's some hidden code page or undisplayable character translation bug? Any help or suggestions?
this is snip of winscp script file
"%PROGRAMFILES(x86)%\WinSCP\WinSCP.com" /log=D:\Card_UCCE_CDW_Extract\Logfiles\winscplog.txt /loglevel=1 /script=D:\Card_UCCE_CDW_Extract\Program_Files\Hadoop_Connection.txt /parameter // %*
Winscp scipt file:
open %1% "-hostkey=""%4%"""