1
我試圖使用WinSCP.com
自動化文件傳輸,這是一個有它的命令和參數的shell。 但自動腳本將從.cmd
或.bat
文件運行。傳遞腳本命令/輸入到打開的WinSCP外殼
因此,這裏是我的自動化腳本:
C:
CD "C:\Program Files (x86)\WinSCP"
CALL WinSCP.com
REM This opens a
REM winscp>
REM shell or process
REM now theoretically I should be able to run the WinSCP commands
REM but they are not being piped into the winscp shell
open mypassword | [email protected]
REM the last command is not being executed.
REM Instead the script hangs on the newly opened WinSCP shell.
REM There are other winscp commands such as put <file> <path>
我的問題是如何判斷的WinSCP過程從批處理腳本文件,把命令open mypassword | [email protected]
?
哦和額外的:我想在最後殺死winscp
process \ shell。這裏我不知道正確的術語。它是進程還是shell?
謝謝!然而,'^'沒有被識別。任何其他方式來分割新行上的命令? – user640853
它也總是詢問我是否要緩存主機密鑰。我該如何打開一個y? – user640853
這是在Windows批處理文件中將命令拆分爲多行的唯一方式(也是正確的)。確保'^'是行中最後一個字符(後面沒有空格),並且在下一行的開始處有一些空格。 –