Solved

7zip batch script

Posted on 2013-01-24
3
711 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
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the Hootsuite Dashboard.

810 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