program Project1;<br><br>{$APPTYPE CONSOLE}<br><br>uses<br> Windows,<br> SysUtils;<br><br>var<br> si: TStartupInfo;<br> pi: TProcessInformation;<br>begin<br> FillChar(si, SizeOf(si), 0);<br> FillChar(pi, SizeOf(pi), 0);<br> si.cb := SizeOf(si);<br> si.dwFlags := STARTF_USESHOWWINDOW;<br> si.wShowWindow := SW_HIDE;<br> si.lpTitle := PChar('hello china');<br> if not CreateProcess(nil, 'C:/WINNT/system32/CMD.EXE',<br> nil, nil, False,<br> CREATE_NEW_CONSOLE,<br> nil, nil, si, pi) then<br> MessageBox(0, 'Error to create process', 'Err',<br> MB_ICONINFORMATION or MB_OK); <br> //WaitForSingleObject(pi.hProcess, 1000*1000);<br>end.