shell在Delphi中对应winexec
//不过推荐你用ShellExecute和CreateProgress

解决方案 »

  1.   

    ...
    commandstr:string;...
    commandstr:='c:\command.com';
    winexec(pchar(commandstr),SW_SHOWNORMAL);
      

  2.   

    在用shell的时候,不要忘了引用'ShellAPI'单元,否则程序会报错!!
      祝你好运!! 工作愉快!!
      

  3.   

    推荐使用CreateProcess,因为这样进程容易控制
    看下面的例子,用ie开一个窗口:
    eg:
    function ConnnectToInternet(Addr:String):Integer;
    var
    Rslt:LongBool;
    StartupInfo:TStartupInfo;
    ProcessInfo:TProcessInformation ;
    IEPath:array [0..MAX_PATH] of Char;
    IEName:String;
    begin
    GetWindowsDirectory(IEPath,MAX_PATH);//获取Windows路径
    IEName:=IEPath+'\Explorer.exe '+Addr; //查找ie
    FillChar(StartupInfo,sizeof(TStartupInfo),0);
    with StartupInfo do
      begin
        cb:=sizeof(TStartupInfo);
        dwFlags:=STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
        wShowWindow:=SW_MAXIMIZE;
      end;
    Rslt:=CreateProcess(nil,Pchar(IEName),nil,nil,false,
        NORMAL_PRIORITY_CLASS,nil,nil,StartupInfo,ProcessInfo);
    if Rslt then
    with ProcessInfo do
    begin
      WaitForInputIdle(hProcess,INFINITE);
      CloseHandle(hThread);
      CloseHandle(hProcess);
      Result:=0;
    end
    else Result:=GetLastError;
    end;