Using echo y as an automated response to a pcp hostkey prompt

前端 未结 2 1478
时光取名叫无心
时光取名叫无心 2020-12-11 13:32

I am building a batch file so that I can push firmware to 600 plus devices.

If I am at a command prompt I can run the following command on a single line that will pu

2条回答
  •  执笔经年
    2020-12-11 14:09

    I ended up using WinSCP.net for the batch file to correctly do what I was trying to do. Here is the example of how to do the above with WinSCP.net.

    @echo off
    
    "C:\Program Files (x86)\WinSCP\WinSCP.com" ^
      /log="C:\Program Files (x86)\WinSCP\WinSCP.log" /ini=nul ^
      /command ^
        "open scp://root:root@192.168.1.1/" ^
        "Put C:\CNA1000\Firmware\CNA1504v1.1.7\CNA1504v1_1_7.run /tmp/."  ^
        "exit"
    
    set WINSCP_RESULT=%ERRORLEVEL%
    if %WINSCP_RESULT% equ 0 (
      echo Success
    ) else (
      echo Error
    )
    
    exit /b %WINSCP_RESULT%
    

    And repeat for each IP address.

提交回复
热议问题