Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the command:

7z.exe x -y -o<dir> <archive dir> * -aoa -r

to extract all archives that are located in the archive directory.

I am running into a problem where exe files that are packaged end up getting extracted as well.

Is there a way to extract all files within a directory but exclude *.exe files?

I tried the -x flag (-x!.exe and -xr!.exe), but they exclude extracting *.exe from within the rar and zip archives.

Thanks for the help.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.