Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

7zip batch script

Posted on 2013-01-24
3
Medium Priority
?
734 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 2000 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

718 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