delphi 如何调用shell命令,谢谢

解决方案 »

  1.   

    Uses shellapi;
    它是一個API函數
      

  2.   

    cmd.exe /c shutdown /r /t 2如这个命令应该怎么写>
      

  3.   

    WinExec('cmd.exe /c shutdown /r /t 2',SW_SHOW);
      

  4.   

    ShellExecute(0, nil, pchar('cmd.exe /c shutdown /r /t 2'), nil, nil, SW_NORMAL)
      

  5.   

    WinExec('ping www.google.com', sw_show);
    看懂吗?直接跟SHELL命令就行了!
      

  6.   

    ShellExecute(Handle,'Open',PChar('cmd.exe'),nil,nil,SW_SHOWNORMAL);????
      

  7.   

    1. 在 uses 里 加 SHELLAPI
    2. ShellExecute(handle, 'open', pchar('cmd.exe'), nil, nil, SW_SHOWNORMAL);