|
|
Question : Using a LIST and LOOP within a batch file
|
|
Hi all, virgin user here.
I have what I think may be a relatively easy question. Not for me, otherwise I wouldn't have ot ask it.
I have a batch file that will be running the winzip command line interface. e.g. wzzip -a -P -r tempfolder\myzip_file.zip somefile.txt
this command line zips up "somefile.txt" into "myzip_file.zip".
The plan is to use that line in a BATfile that will do a bunch of other stuff after zipping up the file. So this line: wzzip -a -P -r tempfolder\myzip_file.zip somefile.txt will be a line in a BAT file.
So I would like to do something like this:
BEGINNING OF BATCH FILE
BEGIN LIST File1.TXT File2.TXT File3.TXT END LIST
wzzip -a -P -r tempfolder\myzip_file.zip VARIABLE
(where this VARIABLE runs this command for every item in the list)
SO I need it to iterate through the list, i.e. loop through the list, and run
"wzzip -a -P -r tempfolder\myzip_file.zip VARIABLE" for each variable, and then continue through the rest of the batch file.
(*NOTE* there is a "@listfile" option in the wzzip.exe program that will pull the contents of a named listfile and include that list in the ZIP file. There is more to this zipfile than what I mentioned, so unfortunately that option is not useful to me in this instance. Just in case you are familiar with this program)
|
Answer : Using a LIST and LOOP within a batch file
|
|
PAQ'd and points refunded as proposed
modulo
Community Support Moderator Experts Exchange
|
|
|
|
|