Advertisement
pietermantel

Untitled

Aug 17th, 2017
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.82 KB | None | 0 0
  1. @echo off
  2. set "minecraft=C:/Users/Coornhert/AppData/Roaming/.minecraft"
  3. setlocal enabledelayedexpansion
  4. set "selected=1"
  5. set "max=0"
  6. cd mods
  7. set a=0
  8. call:print
  9. :menu
  10. choice /c wse>nul
  11. if "!errorlevel!"=="1" (
  12.     if not "!selected!"=="1" (
  13.         set /a "selected-=1"
  14.         call:print
  15.     )
  16. )
  17. if "!errorlevel!"=="2" (
  18.         set /a "selected+=1"
  19.         call:print
  20. )
  21. if "!errorlevel!"=="3" (
  22.     call:run
  23.     call:print
  24. )
  25. goto menu
  26.  
  27. :print
  28. cls
  29. echo.
  30. echo Uninstalled:
  31. echo.
  32. set a=0
  33. set "max=0"
  34. for %%f in (*.jar) do (
  35.     set /a "max+=1"
  36.     if not exist "!minecraft!/mods/%%~nf.jar" (
  37.         set /a "a+=1"
  38.         if "!a!"=="!selected!" (
  39.             echo -%%~nf
  40.         ) else (
  41.             echo  %%~nf
  42.         )
  43.     )
  44. )
  45. echo.
  46. echo Installed:
  47. echo.
  48. for %%f in (*.jar) do (
  49.     if exist "!minecraft!/mods/%%~nf.jar" (
  50.         set /a "a+=1"
  51.         if "!a!"=="!selected!" (
  52.             echo -%%~nf
  53.         ) else (
  54.             echo  %%~nf
  55.         )
  56.     )
  57. )
  58. goto :eof
  59.  
  60. :run
  61. set a=0
  62. for %%f in (*.jar) do (
  63.     if not exist "!minecraft!/mods/%%~nf.jar" (
  64.         set /a "a+=1"
  65.         if "!a!"=="!selected!" (
  66.             copy %%f "!minecraft!/mods/%%~nf.jar"
  67.             if exist %%~nf.txt (
  68.                 for /f "tokens=*" %%B in (%%~nf.txt) do (
  69.                     cd cores
  70.                     copy "%%B" "!minecraft!/mods"
  71.                     cd ..
  72.                 )
  73.             )
  74.         )
  75.     )
  76. )
  77. for %%f in (*.jar) do (
  78.     if exist "!minecraft!/mods/%%~nf.jar" (
  79.         set /a "a+=1"
  80.         if "!a!"=="!selected!" (
  81.             set "old=%CD%"
  82.             cd "!minecraft!/mods"
  83.             del "%%~nf.jar"
  84.             cd !old!
  85.             if exist "%%~nf.txt" (
  86.                 for /F "tokens=*" %%B in (%%~nf.txt) do (
  87.                     set do=1
  88.                     for %%g in (*.txt) do (
  89.                         if exist "!minecraft!/mods/%%~ng.jar" (
  90.                             if exist "%%~ng.txt" (
  91.                                 for /F "tokens=*" %%C in (%%~ng.txt) do if "%%C"=="%%B" set do=0
  92.                             )
  93.                         )
  94.                     )
  95.                     if "!do!"=="1" (
  96.                         set "old=%CD%"
  97.                         cd "!minecraft!/mods"
  98.                         del "%%B"
  99.                         cd !old!
  100.                     )
  101.                 )
  102.             )
  103.         )
  104.     )
  105. )
  106. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement