Raised This Month: $51 Target: $400
 12% 

Batch file / create bz2's in mass quantities


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SlimeCounty
SourceMod Donor
Join Date: Jun 2011
Old 07-10-2012 , 06:35   Batch file / create bz2's in mass quantities
Reply With Quote #1

So, I was compressing tons of custom models, sounds, vmt's and vtf's (custom source materials, etc) this morning, and I mean TONS, doing each manually, getting them ready for my fastdl server. My buddy Squirrel pops into group chat, knows what I'm doing, and throws this batch file at me.

Works like a flipping charm. I thought I'd post it somewhere on these forums, as I feel this is something pretty damn useful for source server owners who compress/upload custom content in large quantities.

I'll attach the file below, but this file assumes 2 things...
7zip is installed in C:\Program Files\7-Zip\7z.exe
and that you want your files compressed to the .bz2 format.

HOW IT WORKS

First, you must have 7zip installed.
Place the .bat file into a directory containing all the files you wish to compress and drag those files into the .bat file, stand back, and watch as it compresses each file into it's own .bz2.

Here's the script, in case you need to change something to suit it for your needs.
Simply copy that into a new txt file, and name it whateveryouwant.bat.

Code:
@Echo Off
:Start
If [%1==[ Goto :EOF
PushD %~pd1
"C:\Program Files\7-Zip\7z.exe" u -tbzip2 %~nx1.bz2 %1
Shift
PopD
Goto Start
Attached Files
File Type: zip bz2.zip (236 Bytes, 3311 views)
__________________

Last edited by SlimeCounty; 07-10-2012 at 06:40.
SlimeCounty is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode