当前位置:编程学习 > Delphi >>

Delphi源码调用CMD

如何在Delphi源码添加CMD功能,要有反回信息。知道的说下,谢了
答案:

一楼那个可以啊~~winexec函数,若函数调用成功,则返回值大于31。失败返回小于31的数,具体的可以百度:winexec

WINEXEC//调用可执行文件
winexec('command.com /c copy *.* c:\',SW_Normal);
winexec('start abc.txt');
ShellExecute或ShellExecuteEx//启动文件关联程序
function executefile(const filename,params,defaultDir:string;showCmd:integer):THandle;
ExecuteFile('C:\abc\a.txt','x.abc','c:\abc\',0);
ExecuteFile(' http://tingweb.yeah.net','','',0);
ExecuteFile('mailto:tingweb@wx88.net','','',0);

 

参考:

http://zhidao.zzzyk.com/question/45426346.html?fr=qrl&cid=93&index=3&fr2=query

winexec(pchar( 'net   use   \\server   123   /user:administrator   >  C:\aa.text '),   sw_hide)

上一个:缺少DELPHI支持文件
下一个:delphi如何实现查看局域网在线主机

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,