Answer the question
In order to leave comments, you need to log in
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
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
Для каждого файла в (*.7z, *.zip, *.rar):
распаковать полноеимяфайла в папку <имяфайла>
если результат 0:
удалить полноеимяфайла
конец
7z -h
or in the help for the GUI version.
There is a module for PowerShell
https://www.powershellgallery.com/packages/7Zip4Po...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question