*.7zip Decompression
조회 수: 61 (최근 30일)
이전 댓글 표시
am able to decompress the *.7zip file using
[status,result] = system(['"C:\Program Files\7za920\7za.exe" -y x ' ...
'"' filename{f} '"' ' -o' '"' outputDir '"']);
but at the time of extraction the 7zip application window is appearing on my window. i just want to suppress that window. can any one help
댓글 수: 0
답변 (4개)
Image Analyst
2016년 2월 17일
If it listens to ActiveX you could launch it first, then minimize it, then do your unzipping command. Do you know how to program in ActiveX?
Nikolay Ampilogov
2021년 7월 27일
Yes, call the Matlab function system() combining the commands via && in following way:
1) to make an archive in a certain folder:
[status,cmdout] = system('C: && cd C:\Program Files\7-Zip && 7z.exe a -t7z -mx8 d:\test\archive.7z d:\test\archive.txt');
where: status - returned code of execution status; cmdout - returned message from the command line (useful to execution control & debug); C: - set C: as current disk; cd C:\Program Files\7-Zip - set the 7Zip installation folder as current; 7z.exe - call 7Zip with parameters: a - make the archive; -t7z - set type of the archive as 7Zip; -mx8 - set the compression level as Maximum; d:\test\archive.7z - file name of the future archive; d:\test\archive.txt - name of the file to be archived;
2) to extract an archive to a certain folder:
[status,cmdout] = system('C: && cd C:\Program Files\7-Zip && 7z.exe x d:\test\archive.7z -od:\test\');
where: status - returned code of execution status; cmdout - returned message from the command line (useful to execution control & debug); C: - set C: as current disk; cd C:\Program Files\7-Zip - set the 7Zip installation folder as current; 7z.exe - call 7Zip with parameters: x - extract the archive from the certain folder; d:\test\archive.7z - file name of the archive; -od:\test\ - extract to folder d:\test\ .
https://stackoverflow.com/questions/39604454/can-matlab-send-detailed-orders-to-7-zip
댓글 수: 1
Walter Roberson
2021년 7월 27일
[status,cmdout] = system('"C:\Program Files\7-Zip\7z.exe" a -t7z -mx8 d:\test\archive.7z d:\test\archive.txt');
should eliminate the need to change default disk (which could lead to other problems)
참고 항목
카테고리
Help Center 및 File Exchange에서 Use COM Objects in MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!