我现在要在程序中执行一个DOS命令行命令怎么写
 
  1 DOS命令为压缩一个文件  arj.exe a xx.arj *.mdb
  2.arj.exe 已存在应用程序目录下
  3.执行命令后,能显示压缩进程,即是否操作成功 请问在VC中怎么实现,谢谢!

解决方案 »

  1.   

    http://www.codeguru.com/console/QuickWin.shtml
      

  2.   

    CreateProcess函数可以
        STARTUPINFO si;
        PROCESS_INFORMATION pi;    ZeroMemory( &si, sizeof(si) );
        si.cb = sizeof(si);
        ZeroMemory( &pi, sizeof(pi) );
    CreateProcess( NULL, // No module name (use command line).
            "*******", // your Command line.
            NULL,             // Process handle not inheritable. 
            NULL,             // Thread handle not inheritable. 
            FALSE,            // Set handle inheritance to FALSE. 
            0,                // No creation flags. 
            NULL,             // Use parent's environment block. 
            NULL,             // Use parent's starting directory. 
            &si,              // Pointer to STARTUPINFO structure.
            &pi )             // Pointer to PROCESS_INFORMATION structure.
        ) 
      

  3.   

    system ("arj.exe a xx.arj *.mdb");是可以的。
      

  4.   

    为什么不给 gezihou(无名) 分?
    用CreateProcess要比system好得多。