*.7zip Decompression
61 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (4)
Image Analyst
am 17 Feb. 2016
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
am 27 Jul. 2021
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 Kommentar
Walter Roberson
am 27 Jul. 2021
[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)
Siehe auch
Kategorien
Mehr zu Use COM Objects in MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!