WinExec('command / c dir > 1.txt',0);
Memo.Lines.LoadFromFile('1.txt');

解决方案 »

  1.   

    WinExec
    ShellExecute
    ShellExecuteEx
    CreateProcess
      

  2.   

    WinExec:过时了,是WINDOWS 3.0时的东西,参数最少最简单
    ShellExecute, ShellExecuteEx:可以打开非程序文件,用与它们关联的程序,可以用各种动词如打印等等。
    CreateProcess:最复杂,参数极多。但控制最完全。
      

  3.   

    WinExec我常用这个。
    不过看阿贵讲了这么多。真得谢谢他。
    让我又学习了新的东西。