I have some large text files that I want to compress. The key is that I want to keep them as separate files. Let's use a little PowerShell scripting to keep this down to one line:
foreach ($file in ls *.txt ) { & 'C:\Program Files\7-Zip\7z.exe' a ($file.name + '.zip') $file.name }
I'm using a simple foreach construct built into PowerShell. I'm saying get all files in this directory that have a .txt extension and then iterate through those files executing whatever is between the curly brackets. In this case it is the command to use 7Zip to compress the file into a new file named the same as the original file with the .zip extension tacked on the end.