If I understand correctly, the problem is that the device on the serial port discards an input that comes too early.
You can solve that by pausing between individual inputs/lines. But then you cannot use an input file. You need generate the input using a "program" that can do the pauses and pipe that input to plink
. An easy way to implement such program is using a compound statement in a batch file:
(
echo root
timeout /t 5 > nul
echo root
timeout /t 5 > nul
echo cd /cfg_usr/delphi/etc
timeout /t 5 > nul
echo rm vip_coding_yes
) | C:PROGRA~1PuTTYplink -load test
The above will produce Windows CRLF line endings. Maybe your device needs *nix CR line endings. You can try the following PowerShell script (script.ps1
):
Write-Host -NoNewline "root`n"
Start-Sleep 5
Write-Host -NoNewline "root`n"
Start-Sleep 5
# ...
And use it like:
powershell.exe -ExecutionPolicy Bypass -File script.ps1 | C:PROGRA~1PuTTYplink -load test
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…