How to create an archive with files from a list in a file ?

M

Marcus Ottmar

I have a file "mylist.txt" where all files are listed which should be added to the
new archive. For this add operation I used the command line interface for either rar
resp. 7zip. In both cases the compression programs do NOT recognize files with embedded blanks
successfully. Is there another way to add these files (with blanks in their filenames).
Do I really have to replace each line in the list by enclosing double quotes?
I guess there must be an option in each of the compression programs to treat
a complete line as ONE file name.

I used:

start /LOW /B /WAIT C:\tools\rar a -tzip D:\myarchive.rar -m5 -s @mylist.txt

or:

start /LOW /B /WAIT C:\tools\7z a D:\myarchive.rar (e-mail address removed)

Marcus
 
P

Pegasus \(MVP\)

Marcus Ottmar said:
I have a file "mylist.txt" where all files are listed which should be added to the
new archive. For this add operation I used the command line interface for either rar
resp. 7zip. In both cases the compression programs do NOT recognize files with embedded blanks
successfully. Is there another way to add these files (with blanks in their filenames).
Do I really have to replace each line in the list by enclosing double quotes?
I guess there must be an option in each of the compression programs to treat
a complete line as ONE file name.

I used:

start /LOW /B /WAIT C:\tools\rar a -tzip D:\myarchive.rar -m5 -s @mylist.txt

or:

start /LOW /B /WAIT C:\tools\7z a D:\myarchive.rar (e-mail address removed)

Marcus

You could try this:

Line1 @echo off
Line2 if exist mylist1.txt del mylist1.txt
Line3 for /F "tokens=*" %%* in (mylist.txt) do echo "%%*" >>
mylist1.txt
Line4 start /LOW /B /WAIT C:\tools\rar a -tzip D:\myarchive.rar -m5 -s
@mylist1.txt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top