Function WinExecExW(cmd,workdir
char;visiable:integer)
WORD;
var
StartupInfo:TStartupInfo;
ProcessInfo:TProcessInformation;
begin
FillChar(StartupInfo,SizeOf(StartupInfo),#0);
StartupInfo.cb:=SizeOf(StartupInfo);
StartupInfo.dwFlags:=STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow:=visiable;
if not CreateProcess(nil,cmd,nil,nil,false,Create_new_console or Normal_priority_class,nil,workdir,StartupInfo,ProcessInfo) then
result:=0
else
begin
waitforsingleobject(processinfo.hProcess,INFINITE);
GetExitCodeProcess(ProcessInfo.hProcess,Result);
end;
end;
调用时,WinExecExW("a.exe","c:/",SW_SHOW);WinExecExW("b.exe","c:/",SW_SHOW);WinExecExW("c.exe","c:/",SW_SHOW);
a.exe执行完了才执行b.exe然后才是c.exe
你自己改改吧