Procedure DOSCommand(Commander,Param:String);
Begin
WinExec(PChar(Commander+' '+Param),SW_NORMAL);
End;
例子:
a.执行EDIT.EXE
DOSCommand('C:/WINDOWS/COMMAND/EDIT.EXE','');
b.执行EDIT.EXE加编辑的文件
DOSCommand('C:/WINDOWS/COMMAND/EDIT.EXE','readme.txt');
c.执行DIR:
DOSCommand('C:/WINDOWS/COMMAND.COM /C','DIR C:/WINDOWS/W/P');
给我加分吧! 谢谢!!!