Delphi 7: how to execute shell command and check the result?

前端 未结 6 428
一整个雨季
一整个雨季 2021-01-01 08:28

I\'m using Delphi 7 and can\'t predict the target version of Windows.

I need to create a database (probably MySql, but might be something else) and define some table

6条回答
  •  盖世英雄少女心
    2021-01-01 08:47

    Here is an article that explains it detail

    Capture the output from a DOS (command/console) Window

    But in short you need to Create two pipes to read and write the output. Then you need to set StdInput and StdOutput in the TStartUpInfo structure, then pass this structure to the CreateProcess() call.

    Here is another article that shows how to Wait for the process to finish.

提交回复
热议问题