Start 7-Zip with Command Line

Help
2004-11-15
2012-12-07
  • Hello,

    I write a small program with the C++ Builder 4 and I will start 7-Zip with this program.
    I will compress a directory with all subdirectories and files.
    Here's my Code:

         AnsiString newZipFile, test, base_archive_File;
         AnsiString ZipPath;
         ZipPath="C:\\Program\\7-Zip\\7z.exe";
         test="testdir\\*";
         base_archive_File="7ziptest.zip";
         newZipFile="c:\\> 7z.exe a -tzip "+ base_archive_File+"  "+test+" -r";

             if(!CreateProcess(ZipPath.c_str(),
                               newZipFile.c_str(), //Argument
                               NULL,             //Security
                               NULL,             //Security
                               FALSE,           //inherits handles
                               0,
                               NULL,
                               NULL,
                               &si,
                               &pi))

    I don't know/find the failure in my code.
    Please, help me!!!!!!!!!!!!!!!

    Thank you!