Azzera filtri
Azzera filtri

*.7zip Decompression

61 visualizzazioni (ultimi 30 giorni)
sri prakash muniyandi
sri prakash muniyandi il 17 Feb 2016
Commentato: Walter Roberson il 27 Lug 2021
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

Risposte (4)

Image Analyst
Image Analyst il 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?
  1 Commento
sri prakash muniyandi
sri prakash muniyandi il 19 Feb 2016
HI i tried with actxserver but am not able to find a Progid for 7zip software. i used actxcontrollist command to list the control in my system. If you know in detail can u share ur knowledge. tnk u....,

Accedi per commentare.


Jan
Jan il 19 Feb 2016
  1 Commento
sri prakash muniyandi
sri prakash muniyandi il 19 Feb 2016
hi i have a problem of decompressing a 7zip data in hide mode.
i tried system command as bellow
[statuse,~] = system(['"' 7zip software path '" -y x ' '"' path of file need to extract '"' ' -o' '"' path of destination folder '"'])
it works but this will pops up the 7zip software application window on my screen. actually i don't want that too happen so i tried a another way
try 2:
i wrote a batch file looks like as below then i called that through matlab system function
cd "7zip software path" start/min 7zG -y x "path which contain my compressed file" -o"Output folder to store a extraction"
In this method am able to do extraction in minimized mode(not in hide mode) but before extraction finish matlab continuous its next statement to execute. actually i want to read one file which is present in the extraction but am not able to read that file because the matlab continuous it's execution before the extraction complete.
So at end i want to decompress some *.7z folder from matlab in a hide mode.can plz help on this....,

Accedi per commentare.


sri prakash muniyandi
sri prakash muniyandi il 23 Feb 2016
Hi all,
7zip file manager software given two exe versions as 7z.exe and 7zG.exe. 7zG.exe is the one for gui application and 7z.exe is the one for command line operation.so when you use 7z.exe the extraction will happen in hidden mode.

Nikolay Ampilogov
Nikolay Ampilogov il 27 Lug 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 Commento
Walter Roberson
Walter Roberson il 27 Lug 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)

Accedi per commentare.

Categorie

Scopri di più su Use COM Objects in MATLAB in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by