Extracting a 7-Zip file “silently” - command line option

后端 未结 14 2269
南笙
南笙 2021-02-06 23:19

I want to extract a 7-Zip archive in a Python script. It works fine except that it spits out the extraction details (which is huge in my case).

Is there a way to avoid t

相关标签:
14条回答
  • 2021-02-07 00:15

    You can stop 7-Zip from displaying prompts by using the -y switch. This will answer yes to all prompts. Use this only when you are confident.

    0 讨论(0)
  • 2021-02-07 00:16

    Examining 7zip source I found hidden -ba switch that seems to do the trick. Unfortunately it is not finished. I managed to make it work with several modifications of sources but it's just a hack. If someone's interested, the option variable is called options.EnableHeaders and changes are required in CPP/7zip/UI/Console/Main.cpp file. Alternatively you can poke 7Zip's author to finish the feature in tracker. There are several requests on this and one of them is here.

    0 讨论(0)
提交回复
热议问题