重庆市委新书记是谁:怎么在DELPHI程序中执行DOS命令

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 12:48:25
怎么在DELPHI程序中执行DOS命令,我看过一个程序代码,能不能说详细点WINEXEC方法,我是新手
有回贴我还是不明白

WinExec('Command.com /C main.exe > tmp.txt',SW_Hide);
WinExec -- windows api function
Command.com /C string -- Carries out the command specified by string, and then stops.
main.exe > tmp.txt -- dos 命令行 你可以改称你想要的, 如 copy c:\a d:\
只要是命令行能行, 放到这也行
SW_Hide -- WinExec参数, 表示 运行时隐藏dos的那个黑框

关于 WinExec, 请查 menu HELP --> Windows SDK
关于 Command, 可以在dos窗口中,输入 command /? 查看