试试看:procedure TForm1.FormCreate(Sender: TObject);begin //ShellExecute(Handle, 'open','cmd.exe', '/k start ping 127.0.0.1', nil, SW_NORMAL); //要 uses Shellapi; WinExec('cmd.exe /k start ping 127.0.0.1',SW_NORMAL);end;