Solved

7zip batch script

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

Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

Question has a verified solution.

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

Suggested Solutions

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now