I have a text file that I want to be archived with each file in a particular folder.
For example, the folder has: File1
, File2
, File3
, and TextDoc1
.
I want to create File1.zip
(which includes File1
and TextDoc1
), File2.zip
(which includes File2
and TextDoc1
), and File3.zip
(which includes File3
and TextDoc1
).
Is there a batch command that I can run (as a .bat) to create these archives instead of making each one individually? I've been using listfiles, but I still need to create each .txt
file with the filenames in it.
This is what I've been using:
"C:\Program Files\WinRAR\WinRAR.exe" a -esh -m3 -mt2 -r -t "File1.zip" @"File1.txt"
"C:\Program Files\WinRAR\WinRAR.exe" a -esh -m3 -mt2 -r -t "File2.zip" @"File2.txt"
etc.
Zip or Rar is fine.