[問題] 如何對CreateProcess建的console做input?
開發平台(Platform): Windows
編譯器 VC++
問題(Question):
請問如果想用CreateProcess呼叫如git-bash的bash程式
該如何在後續的程式中使其能執行命令? (下某指令並執行)
程式碼(Code):(請善用置底文網頁, 記得排版)
我參考 http://tinyurl.com/zdou3hu redirected I/O
STARTUPINFO si;
si.hStdInput = handleForInput;
再在CreateProcess喚起該bash後
WriteFile(handleForInput, TEXT("我的某個指令"), dwWriteLength, &dwWritten, ...
但並沒有如預期在該bash中寫入我的某個指令並執行
請問要怎麼修改呢?
謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.14.164.18
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1481007055.A.092.html
→
12/06 18:28, , 1F
12/06 18:28, 1F
→
12/07 08:38, , 2F
12/07 08:38, 2F
→
12/07 10:46, , 3F
12/07 10:46, 3F