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 use 7Zip in batch process under Windows OS.

If I use "a" command (to add files to new archive file that doesn't exist) 7Zip still succeeds even if the file I explicitly specified to be added doesn't exist - ZIP file is created but is has no files inside it.

Is there an additional 7Zip command line option that would cause 7Zip to fail when the file I want to be added doesn't exist?

share|improve this question

I would suggest checking if the file exists before calling 7Zip.

if exist {insert file name here} (
rem file exists
) else (
rem file doesn't exist

From How to check if a file exists from inside a batch file

share|improve this answer
Yeah, I thought of this and probably will end up doing it but was hoping to avoid additional step. – Joe Schmoe Aug 17 '12 at 19:18

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.