# 7zip command line - Exclude files HOW?

This topic is 3212 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey! I'd like to be able to backup some folders with 7zip and I want certain files to be left out. I'm currently using the following command line
7zG.exe a game.7z lib game -mx=9 -x!*.o!*.a!*.def!*.exe!*.dll


but it doesn't exclude the files. It's obvious that I'm not doing it right, but I'm unable to find any example on how to do this properly. NOTE: oh, I posted this in the wrong forum.

##### Share on other sites
Use -x multiple times, or at least that's what this linky says (under "Excluding Files"). Of course, I found this from [google] as the first result...

##### Share on other sites
It just doesn't work, look the command output:

C:\coding\work>7z.exe a test.7z ./test -x!*.o7-Zip 4.64  Copyright (c) 1999-2009 Igor Pavlov  2009-01-03ScanningCreating archive test.7zCompressing  test\game\data\texture\default.pngCompressing  test\Events\engine\cdevices.hCompressing  test\Events\engine\cdisplay.hCompressing  test\Events\engine\cevent.hCompressing  test\Events\engine\ckeyboard.hCompressing  test\Events\engine\cmouse.hCompressing  test\Events\engine\csystem.hCompressing  test\Events\engine\ctemplate.hCompressing  test\game\obj\engine\application.o <-- WTF!?!?!Break signaled

##### Share on other sites
According to the third result from this google search, you need to specify "r" to make it exclude files recursively. Like so:

7z.exe a test.7z ./test -xr!*.o