1

I'm using the 7z.exe program to extract some .rar files. If the file is a password protected file, and if I didn't provide the password, the 7z program prompts and asks for the password. It looks like this:


7-Zip 18.06 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2018-12-30

Scanning the drive for archives:
1 file, 10199038 bytes (9960 KiB)

Extracting archive: c:\temp\test\a.rar

Enter password (will not be echoed):

Is it possible to modify this behavior so that when I didn't provide a password, it just errors out and exit? Thanks.

Btw, I'm on Windows 10.

2
  • Doesn't it do just that if you press enter without typing a password? Mar 11, 2022 at 17:27
  • @ChanganAuto Yes. But I use the command in a batch file. User interaction is not possible in my case. Mar 11, 2022 at 18:43

1 Answer 1

0

You can use empty password to allow 7zip silently fail without prompt. This will normally work with unencrypted archives as well.

7za.exe x archive_encrypted.7z -p""

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .