在2000下用什么命令可以启动命令提示符窗口(dos窗口)并在此窗口下执行一个文件!!

解决方案 »

  1.   

    运行〉cmd
    c:\>notepad.exe
    打开记事本
      

  2.   

    this statement for launching run.exe
    cmd.exe /c run.exe
      

  3.   

    shellexec "cmd.exe", "a.txt", "/c"...
      

  4.   

    WinExec( "cmd.exe /c run.exe",SW_HIDE );  //lanuch run.exe
    /////
    u can use WinExec("run.exe",SW_HIDE) directly
      

  5.   

    WinExec( "cmd.exe",SW_NORMAL );  
    you can do something under dos
      

  6.   

    我想用Createprocess,有例子吗?谢谢!尤其字符串中间的空格怎么处理?
      

  7.   

    HINSTANCE ShellExecute(
        HWND hwnd, //this->m_hWnd
        LPCTSTR lpOperation,//"open"
        LPCTSTR lpFile, //"cmd.exe"
        LPCTSTR lpParameters, //"a.txt"
        LPCTSTR lpDirectory,//NULL
        INT nShowCmd//SW_SHOWNORMAL
    );
    To open a folder, use either of the following calls: ShellExecute(handle, NULL, path_to_folder, NULL, NULL, SW_SHOWNORMAL);or ShellExecute(handle, "open", path_to_folder, NULL, NULL, SW_SHOWNORMAL);To explore a folder, use: ShellExecute(handle, "explore", path_to_folder, NULL, NULL, SW_SHOWNORMAL);To launch the Shell's Find utility for a directory, use:ShellExecute(handle, "find", path_to_folder, NULL, NULL, 0);