Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Essentially I host all my music on an FTP so friends and family can access it with ease, and I can access it from abroad etc. But the only issue is that each track needs to be downloaded manually.

I was wondering if anyone knows of a way to create some sort of script, maybe a batch file, that can auto ZIP (or RAR) folders in a folder, and any new folders added to that folder, so whole artists/albums can be downloaded at once. This would be pretty neat!

share|improve this question
up vote 1 down vote accepted

If there's only one folder deep, then from a batch file:

set zip="c:\program files\7-zip\7z.exe" a -tzip -r
for /d %%f in (c:\myaudiofolder) do if not exist %%~nf.zip %zip% %%~nf.zip %%f

Or, if there are multiple folders and you want each folder to get its own zip file, in the parent folder, again from a batch file:

set zip="c:\program files\7-zip\7z.exe" a -tzip -r
dir c:\myaudiofolder /ad /s /b > c:\myaudiofolder\folders.txt
for /f %%f in (c:\myaudiofolder\folders.txt) do if not exist c:\myaudiofolder\%%~nf.zip %zip% c:\myaudiofolder\%%~nf.zip %%f

You could substitute other executables/parameters to cause the files to be compressed into .rar files, etc. I just wrote it that way to make it easier to read.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .