Last active
July 4, 2016 20:07
-
-
Save shibacho/980d508a2d78e8c34ab7dd875b3bc0f3 to your computer and use it in GitHub Desktop.
(BMS zip compression) BMS の各フォルダを無圧縮zipにしてバックアップフォルダを作る
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM What do this batch file? | |
REM Archive each bms folders using uncompressed zip format, | |
REM and put thost the backup folder. | |
REM BMSの各フォルダを無圧縮ZIPでまとめてバックアップフォルダに置きます。 | |
REM How to use | |
REM Copy to one up hierarchy of the BMS folder location and execute. | |
REM BMSフォルダの一つ上のフォルダに置いてダブルクリックします | |
@echo off | |
REM Set the location of 7za.exe. | |
REM 7zipのコマンドライン版7zaは自分で適当な場所に置いて設定してください。 | |
set exe="C:\7za\7za.exe" | |
set T1=%TIME: =0% | |
REM prefix of the backup folder | |
set prefix="bms" | |
REM -------------------------------- | |
set backupdir=%prefix%%date:~0,4%%date:~5,2%%date:~8,2% | |
echo "Backup Directory is %backupdir%" | |
mkdir %backupdir% | |
for /D %%d in (*) do ( | |
cd "%%d" | |
mkdir "..\%backupdir%\%%d" | |
echo "Change directory %%d" | |
for /D %%i in (*) do ( | |
if not %%i == %backupdir% ( | |
echo "Compressing %%i -> ..\%backupdir%\%%d\%%i.zip" | |
%exe% a "..\%backupdir%\%%d\%%i.zip" -tzip -mx=0 -r "%%i" >> NUL | |
) | |
) | |
cd .. | |
) | |
set T2=%TIME: =0% | |
echo Begin time:%T1% | |
echo End time:%T2% | |
echo Done. Backup files are in %backupdir% | |
PAUSE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment