0

There is a folder that contains many folders and subfolders, and each of these contains any number of password-protected 7zip archives. The password is the same for all of them. These are single-layer archives (no archives within archives).

I am trying to extract all of them in a single command in such a way that:

  1. Every file will be extracted to the directory in which its original archive was located without a subfolder being created for it,
  2. Each original archive file will be deleted,
  3. and the password will be input automatically by the command.

I already know this needs to be some kind of script since the 7zip context menu doesn't allow to do this AFAIK. However, I am not well-versed in command-line usage and would really appreciate if someone could provide a script I could copy-paste...

I already looked through a bunch of answers, including the following that describe a similar situation minus the password aspect:

3
  • 1. 7z.exe -? shows that -y switch means assume Yes on all queries. 2. 7zip sets errorlevel upon an error. So you could add if errorlevel 1 (call :error) else (del "%%~nxZ") in your batch file (and add :error subroutine)…
    – JosefZ
    Apr 27, 2021 at 15:21
  • 1. understood. 2. not understood... could you expand?
    – Bamba
    Apr 27, 2021 at 18:07
  • Please edit the question and share a code snippet you have so far.
    – JosefZ
    Apr 27, 2021 at 18:49

0

You must log in to answer this question.

Browse other questions tagged .