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'm using a batch script to output filenames with specific attributes to a .txt file, in this case older than 30 days. I'd like to then zip or rar those files that are listed in the .txt file.

How would I go about doing this?

share|improve this question
Can you update your question to clarify what operating system you are using? – Mox Sep 6 '13 at 2:25
Windows 7 to create the batch, i'd like it to be cross compatible with other Windows editions though. Thanks – Matt Sep 6 '13 at 2:30
At the moment, I'm outputting full path to txt file, so it looks a little like this; – Matt Sep 6 '13 at 2:30
C:\folder\file.txt C:\folder\file2.txt and so on.. – Matt Sep 6 '13 at 2:32

According to 7z command line options:

Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]

You can use @ for the file contains file list. For example to compress files in filelist.txt into, use the following command

7z a @filelist.txt
share|improve this answer
I've tried my command and it worked perfectly – Lưu Vĩnh Phúc Sep 6 '13 at 7:49

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.