L
L
leaningless2020-01-24 02:05:39
7-Zip
leaningless, 2020-01-24 02:05:39

What is the command for 7zip to unpack archives from a given directory?

I couldn't find a simple script to unpack all archives of various types from D:\Downloads into subfolders according to the names of the archives and then delete the archives.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
wisgest, 2020-01-24
@leaningless

If you limit yourself to a single call to 7-Zip, then you can unpack all archives from the current directory into directories of the same name (without extensions) with the command
But, as far as I know, 7-Zip allows you to delete only files inside archives or after successfully adding to the archive. Therefore, to delete archives, you must use third-party tools in relation to 7-Zip. For example, in a batch file Or redirect the output to a file and then get the names of (successfully) processed archives from it in order to delete them ...
7z

K
kisaa, 2020-01-24
@kisaa

Для каждого файла в (*.7z, *.zip, *.rar):
   распаковать полноеимяфайла в папку <имяфайла>
   если результат 0:
      удалить полноеимяфайла
конец

7zip commands can be viewed through 7z -hor in the help for the GUI version.

A
Alexey Dmitriev, 2020-01-24
@SignFinder

There is a module for PowerShell
https://www.powershellgallery.com/packages/7Zip4Po...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question