Solved

7zip batch script

Posted on 2013-01-24
3
730 Views
Last Modified: 2013-02-19
I'm looking for a 7zip batch script to archive .pdf and .txt files in one archive with a .zip extension.
0
Comment
Question by:lsbrown1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:pabma
ID: 38814049
Not the best specification I've seen, but hey! :-)

Are the files across multiple directories, or all in a single directory?
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 38814062
create file called listfile.txt and add the source directory of *.pdf and *.txt files you want to archive.

for example:
c:\temp\*.pdf
c:\temp\txt\*.txt

run the following code:

7z.exe a -tzip archive.zip @listfile.txt

Open in new window


after the @ should come the full path of the listfile.txt, unless running from he same directory
0
 

Author Comment

by:lsbrown1
ID: 38817063
This is the code I was  using but Im getting errors: (1) its saving files in  c:\Program Files\7-Zip, I want it to save .zip in c:\Inetpub\ftproot\xxxxxxx( c:\Inetpub\ftproot\xxxxxxx is also where the .pdf and .txt files I want to zip is located) (2) its not giving me the date stamp


cd  c:\Program Files\7-Zip
7z.exe a -tzip xx_xxxxx_`date +%Y%m%d`.zip c:\Inetpub\ftproot\xxxxxxx\*.pdf *.txt
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question