当前位置:主页>销售管理软件> 列表

CreateProcess执行带管道符输出到文件的命令怎么 找速达进销存财务软件

库存管理软件版1楼: 好像根本没执行,也没有文件生成

或者那个大哥告诉我怎么ping完了马上得到延迟的平均秒数,不能靠icmpreply
cmd:=''ping ''+address+'' -l 1000 >''+''"''+filename+''"'';
runcommand(cmd,'''');
procedure TForm1.runcommand(filename,para:ansistring);
var WindowHandle:HWND;
var commandline:ansistring;
StartupInfo:TStartupInfo;
ProcessInfo:TProcessInformation;
begin
commandline:=filename+'' ''+para;
FillChar(StartupInfo,Sizeof(StartupInfo),#0);
StartupInfo.cb := Sizeof(StartupInfo);
StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow := SW_HIDE ;

if not CreateProcess(nil,
pchar(commandline),
nil,
nil,
false,
CREATE_NEW_CONSOLE or
NORMAL_PRIORITY_CLASS,
nil,
nil,
StartupInfo,
ProcessInfo) then
begin

end
else
begin
WaitforSingleObject(ProcessInfo.hProcess,INFINITE);
//命令执行完后再会继续下去
end;

end;

2楼: 日
只能先生成个bat文件,然后执行bat行了 如速达进销存财务软件

3楼: use ShellApi;
ShellExecute(Handle, ''open'', ''cmd'', ''/c ping 192.168.100.1 -n 20>> e:\b.txt'', nil, 0);

4楼: ShellExecute没办法等着命令执行完了才走下一步的

5楼: 加入-t参数

6楼: 能否把加入-t的具体表示法写出来

ping这个问题我解决了的