Advertisement
Shimatora

EFZ Replay Renamer

Mar 23rd, 2018
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. @echo off
  2. rem 【ATTENTION!】Use of this script is at the user's own risk.
  3. rem 【ATTENTION!】Copy this into notepad, fill out the paths below and save as a .bat file to use.
  4. 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.
  5. rem 【ATTENTION!】↓ Paste the path to your EFZ folder below, like so: EFZpath=C:/Users/Shima/Games/EFZ/REPLAY
  6. rem ↓「EFZpath=」Don't delete the EFZpath= bit!
  7. set EFZpath=
  8. rem 【ATTENTION!】In the event the amount of replays exceeds 81, a sub folder will be made.
  9. rem If you would like to change the name of this sub folder, please input the name below. Make sure not to delete「sub=」!
  10. set sub=sub
  11.  
  12. set EFZpathoriginal=%EFZpath%
  13.  
  14.  
  15. rem ドラッグ、ダブルクリックどちらでも実行可能なように調整
  16. set filepathinput=%~1
  17. if "%filepathinput%"=="" set filepathinput=%cd%
  18. echo %filepathinput%
  19. echo %EFZpath%
  20.  
  21. rem countAは前、countBは後ろ、filecountはファイル数、dircountは81戦超えた時用
  22. set countA=1
  23. set countB=0
  24. set filecount=0
  25. set dircount=0
  26. rem 指定したフォルダ内のリプレイファイルの名前を抽出
  27. echo "%filepathinput%\*.rep"
  28. for /f "usebackq delims=. tokens=1" %%f in (`dir "%filepathinput%\*.rep" /A-D /b /od`) do call :replaycopy %%f
  29. rem ↓デバッグ用、pause>nulを消せばオートでプロンプトが閉じる。
  30. pause>nul
  31. exit /b
  32.  
  33. rem リプレイをコピーする箇所。
  34. :replaycopy
  35. rem 81戦コピーしたら、サブフォルダを作成する処理に移動
  36. if "%filecount%"=="81" goto diradd
  37. rem 9戦コピーしたら、次のページに移る(dataX-YのXを書き換える)
  38. if "%countB%"=="9" goto pageadd
  39. set /a countB=countB+1
  40. rem namefrom=コピー元のファイル名
  41. set namefrom=%filepathinput%\%*.rep
  42. rem nameto=コピー先のファイル名
  43. set nameto=%EFZpath%\data%countA%-%countB%.rep
  44. echo %namefrom%
  45. echo %nameto%
  46. rem echo now make "%EFZpath%\data%countA%-%countB%.rep"
  47. rem コピー実行
  48. copy /y "%namefrom%" "%nameto%"
  49. set /a filecount=filecount+1
  50. rem pause>nul
  51. exit /b
  52.  
  53. rem 改ページ用 dataX-Y の Xを加算する
  54. :pageadd
  55. set /a countB=0
  56. set /a countA=countA+1
  57. rem echo %countA%
  58. goto replaycopy
  59.  
  60. rem 81戦超えた時用の振る舞い
  61. :diradd
  62. set /a dircount=dircount+1
  63. set countA=1
  64. set countB=0
  65. echo making %EFZpathoriginal%\%sub%%dircount%
  66. rem subで指定した名前プラス番号をつけて、新しくディレクトリを作成する
  67. mkdir "%EFZpathoriginal%\%sub%%dircount%"
  68. rem 以降のファイルコピー処理時に、サブディレクトリを参照する
  69. set EFZpath=%EFZpathoriginal%\%sub%%dircount%
  70. set filecount=0
  71. goto replaycopy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement