Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.