Home > Software engineering >  VC call 7 z. extract exe command line to achieve the specified file
VC call 7 z. extract exe command line to achieve the specified file

Time:10-08

Three out for a Test. Rar file 1. TXT 2. TXT 3. TXT, I want to by calling the 7 z. Exe command unzip 2. TXT file,
Search on the Internet are directly to the Test. Rar whole to extract, turn to extract method of the specified file ~ ~ ~ ~ ~ ~ ~ ~ ~
Online code is as follows:
Extract:
Void CTestXXXDlg: : OnXXX ()
{
//TODO: Add your the control notification handler code here
Cstrings str7zPath;
Str7zPath=_T (" C: \ \ Program Files \ \ 7 - Zip \ \ 7 z. Exe ");
Cstrings strZipPath=_T (" D: \ \ DirRoot \ \ MemTest 7 z ");//to unzip the file's absolute path
Cstrings strSaveDir;
StrSaveDir=strZipPath. Left (strZipPath. ReverseFind (_T (' \ \ ')));
Cstrings strP;//parameter
StrP. The Format (_T (" e - - y o % s % s "), strZipPath, strSaveDir);
HINSTANCE hRet=ShellExecute (NULL, "open", str7zPath, strP, NULL, SW_HIDE);//SW_SHOW display dialog
if (! HRet)
{
MessageBox (_T (" decompression failed!" ), _T (" tip "), MB_ICONERROR);
} the else
{
MessageBox (_T (" decompression success!" ), _T (" tip "), MB_ICONINFORMATION);
}
}

Description know grateful ~ ~ ~ ~ ~ ~ ~ ~
Turn to extract the file specified way ~ ~ ~ ~ ~ ~ ~ ~ ~

CodePudding user response:

You can see the specification 7 z order, at the end of the parameters can be specified to operate files, or file list

Such as:
 
7 za. The exe e 1. Zip - ov: \ out 2. TXT

CodePudding user response:

Installed after 7 zip, in the same directory as the 7 - the zip has a help file, there are 7 - zip detail
all the command line

  • Related