Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem 【ATTENTION!】Use of this script is at the user's own risk.
- rem 【ATTENTION!】Copy this into notepad, fill out the paths below and save as a .bat file to use.
- rem 【ATTENTION!】Place the saved .bat file into a folder with the replays you want to rename and double click the .bat file to run.
- rem 【ATTENTION!】↓ Paste the path to your EFZ folder below, like so: EFZpath=C:/Users/Shima/Games/EFZ/REPLAY
- rem ↓「EFZpath=」Don't delete the EFZpath= bit!
- set EFZpath=
- rem 【ATTENTION!】In the event the amount of replays exceeds 81, a sub folder will be made.
- rem If you would like to change the name of this sub folder, please input the name below. Make sure not to delete「sub=」!
- set sub=sub
- set EFZpathoriginal=%EFZpath%
- rem ドラッグ、ダブルクリックどちらでも実行可能なように調整
- set filepathinput=%~1
- if "%filepathinput%"=="" set filepathinput=%cd%
- echo %filepathinput%
- echo %EFZpath%
- rem countAは前、countBは後ろ、filecountはファイル数、dircountは81戦超えた時用
- set countA=1
- set countB=0
- set filecount=0
- set dircount=0
- rem 指定したフォルダ内のリプレイファイルの名前を抽出
- echo "%filepathinput%\*.rep"
- for /f "usebackq delims=. tokens=1" %%f in (`dir "%filepathinput%\*.rep" /A-D /b /od`) do call :replaycopy %%f
- rem ↓デバッグ用、pause>nulを消せばオートでプロンプトが閉じる。
- pause>nul
- exit /b
- rem リプレイをコピーする箇所。
- :replaycopy
- rem 81戦コピーしたら、サブフォルダを作成する処理に移動
- if "%filecount%"=="81" goto diradd
- rem 9戦コピーしたら、次のページに移る(dataX-YのXを書き換える)
- if "%countB%"=="9" goto pageadd
- set /a countB=countB+1
- rem namefrom=コピー元のファイル名
- set namefrom=%filepathinput%\%*.rep
- rem nameto=コピー先のファイル名
- set nameto=%EFZpath%\data%countA%-%countB%.rep
- echo %namefrom%
- echo %nameto%
- rem echo now make "%EFZpath%\data%countA%-%countB%.rep"
- rem コピー実行
- copy /y "%namefrom%" "%nameto%"
- set /a filecount=filecount+1
- rem pause>nul
- exit /b
- rem 改ページ用 dataX-Y の Xを加算する
- :pageadd
- set /a countB=0
- set /a countA=countA+1
- rem echo %countA%
- goto replaycopy
- rem 81戦超えた時用の振る舞い
- :diradd
- set /a dircount=dircount+1
- set countA=1
- set countB=0
- echo making %EFZpathoriginal%\%sub%%dircount%
- rem subで指定した名前プラス番号をつけて、新しくディレクトリを作成する
- mkdir "%EFZpathoriginal%\%sub%%dircount%"
- rem 以降のファイルコピー処理時に、サブディレクトリを参照する
- set EFZpath=%EFZpathoriginal%\%sub%%dircount%
- set filecount=0
- goto replaycopy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement