Low Level Console Input and Redirection

前端 未结 1 2022
天命终不由人
天命终不由人 2021-02-09 22:44

I\'m trying to send commands to to the input of a cmd.exe application using the low level read/write console functions. I have no trouble reading the text (scraping

1条回答
  •  眼角桃花
    2021-02-09 22:54

    Right now you're trying to write to your own stdin handle, not the one for the cmd.exe process. You'll have to do a lot more work to redirect the input handle for that one. It requires a pipe. Here's a KB article that shows the boilerplate code.

    Btw: always check the return value of API functions.

    0 讨论(0)
提交回复
热议问题