Advertisement
Kleew

Fallout 4 INI Read Only Toggle

Oct 17th, 2022 (edited)
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 5.36 KB | Gaming | 0 0
  1. @echo off
  2. color 03
  3. ::mode is the consoles window size 55=width, 13=height. Don't go below 13 height, this might result in loss of characters.
  4. mode 55,13
  5. title Fallout 4 INI Read only toggle
  6. :start
  7. set /a ini1=0
  8. set /a ini2=0
  9. set /a ini3=0
  10. set /a ini4=0
  11. set /a ini5=0
  12. cls
  13. echo [?25h
  14. if exist %~dp0\fo4SteamPath.bat (
  15.     call %~dp0\fo4SteamPath.bat
  16.     goto next
  17. ) else (
  18.     cls
  19. )
  20.     echo  Full Fallout 4 Steam path.
  21.     set SteamPath1=NOT SET
  22.     echo example: G:\steam\steamapps\common\Fallout 4
  23.     set /p SteamPath1= Steam Path:
  24.     (echo set SteamPath=%SteamPath1%) > %~dp0\fo4SteamPath.bat
  25.     set SteamPath=%SteamPath1%
  26. :next
  27. if exist %~dp0\fo4MyGamesPath.bat (
  28.     call %~dp0\fo4MyGamesPath.bat
  29.     goto start2
  30. ) else (
  31.     cls
  32. )
  33.     set MyGamesPath1=NOT SET
  34.     echo  Full Fallout 4 My Games path.
  35.     echo example: C:\users\myuser\Documents\My Games\Fallout4
  36.     set /p MyGamesPath1= My Games Path:
  37.     (echo set MyGamesPath=%MyGamesPath1%) > %~dp0fo4MyGamesPath.bat
  38.     set MyGamesPath=%MyGamesPath1%
  39. :start2
  40. call %~dp0\fo4SteamPath.bat
  41. call %~dp0\fo4MyGamesPath.bat
  42. set /a readOnly=1
  43. :start3
  44. echo [?25l
  45. cls
  46. if exist "%MyGamesPath%\Fallout4.ini" (attrib +r "%MyGamesPath%\Fallout4.ini") else set /a ini1=1
  47. if exist "%MyGamesPath%\Fallout4Custom.ini" (attrib +r "%MyGamesPath%\Fallout4Custom.ini") else set /a ini2=1
  48. if exist "%MyGamesPath%\Fallout4Prefs.ini" (attrib +r "%MyGamesPath%\Fallout4Prefs.ini") else set /a ini3=1
  49. if exist "%SteamPath%\Fallout4_Default.ini" (attrib +r "%SteamPath%\Fallout4_Default.ini") else set /a ini4=1
  50. if exist "%SteamPath%\fallout4\Fallout4Prefs.ini" (attrib +r "%SteamPath%\fallout4\Fallout4Prefs.ini") else set /a ini5=1
  51. if %ini1% equ 1 goto missingFiles
  52. if %ini2% equ 1 goto missingFiles
  53. if %ini3% equ 1 goto missingFiles
  54. if %ini4% equ 1 goto missingFiles
  55. if %ini5% equ 1 goto missingFiles
  56. echo Steam:%SteamPath%
  57. echo My Games:%MyGamesPath%
  58. echo Read only:
  59. echo 1. [Toggle Read only]
  60. echo 2. [Open directories]
  61. echo 3. [Change paths]
  62. echo.
  63. :return
  64. if %readOnly% equ 1 echo ON 
  65. if %readOnly% equ 2 echo OFF  
  66. echo                                                 
  67. echo                                                 
  68. choice /c 123 > nul
  69. if %errorlevel% equ 3 goto paths1
  70. if %errorlevel% equ 2 goto openDIRS
  71. if %errorlevel% equ 1 goto attrib1
  72. :attrib1
  73. if %readOnly% equ 1 goto attribOFF
  74. if %readOnly% equ 2 goto attribON
  75. :attribOFF
  76. echo 1. [Toggle Read only]
  77. if exist "%MyGamesPath%\Fallout4.ini" (attrib -r "%MyGamesPath%\Fallout4.ini") else set /a ini1=1
  78. if exist "%MyGamesPath%\Fallout4Custom.ini" (attrib -r "%MyGamesPath%\Fallout4Custom.ini") else set /a ini2=1
  79. if exist "%MyGamesPath%\Fallout4Prefs.ini" (attrib -r "%MyGamesPath%\Fallout4Prefs.ini") else set /a ini3=1
  80. if exist "%SteamPath%\Fallout4_Default.ini" (attrib -r "%SteamPath%\Fallout4_Default.ini") else set /a ini4=1
  81. if exist "%SteamPath%\fallout4\Fallout4Prefs.ini" (attrib -r "%SteamPath%\fallout4\Fallout4Prefs.ini") else set /a ini5=1
  82. if %ini1% equ 1 goto missingFiles
  83. if %ini2% equ 1 goto missingFiles
  84. if %ini3% equ 1 goto missingFiles
  85. if %ini4% equ 1 goto missingFiles
  86. if %ini5% equ 1 goto missingFiles
  87. set /a readOnly=2
  88. timeout /t 1 /nobreak > nul
  89. echo 1. [Toggle Read only]
  90. goto return
  91. :attribON
  92. echo 1. [Toggle Read only]
  93. if exist "%MyGamesPath%\Fallout4.ini" (attrib +r "%MyGamesPath%\Fallout4.ini") else set /a ini1=1
  94. if exist "%MyGamesPath%\Fallout4Custom.ini" (attrib +r "%MyGamesPath%\Fallout4Custom.ini") else set /a ini2=1
  95. if exist "%MyGamesPath%\Fallout4Prefs.ini" (attrib +r "%MyGamesPath%\Fallout4Prefs.ini") else set /a ini3=1
  96. if exist "%SteamPath%\Fallout4_Default.ini" (attrib +r "%SteamPath%\Fallout4_Default.ini") else set /a ini4=1
  97. if exist "%SteamPath%\fallout4\Fallout4Prefs.ini" (attrib +r "%SteamPath%\fallout4\Fallout4Prefs.ini") else set /a ini5=1
  98. if %ini1% equ 1 goto missingFiles
  99. if %ini2% equ 1 goto missingFiles
  100. if %ini3% equ 1 goto missingFiles
  101. if %ini4% equ 1 goto missingFiles
  102. if %ini5% equ 1 goto missingFiles
  103. set /a readOnly=1
  104. timeout /t 1 /nobreak > nul
  105. echo 1. [Toggle Read only]
  106. goto return
  107. :openDIRS
  108. echo 2. [Open directories]
  109. echo Opening dir %SteamPath%
  110. echo Opening dir %MyGamesPath%
  111. start explorer.exe %SteamPath%
  112. start explorer.exe %MyGamesPath%
  113. timeout /t 1 /nobreak > nul
  114. echo 2. [Open directories]
  115. goto return
  116. :paths1
  117. del %~dp0\fo4SteamPath.bat > nul
  118. del %~dp0fo4MyGamesPath.bat > nul
  119. goto start
  120. :missingFiles
  121. cls
  122. echo  Steam:%SteamPath%
  123. echo  My Games:%MyGamesPath%
  124. echo.
  125. echo  Missing file^(s^)
  126. echo.
  127. if %ini1% equ 1 echo  Fallout4.ini ^(My Games^) was not found.
  128. if %ini2% equ 1 echo  Fallout4Custom.ini ^(My Games^) was not found.
  129. if %ini3% equ 1 echo  Fallout4Prefs.ini ^(My Games^) was not found.
  130. if %ini4% equ 1 echo  Fallout4_Default.ini ^(Steam^) was not found.
  131. if %ini5% equ 1 echo  Fallout4Prefs.ini ^(Steam/Fallout4/^) was not found.
  132. echo.
  133. echo  Press any key to redo pathing.
  134. pause > nul
  135. del %~dp0\fo4SteamPath.bat > nul
  136. del %~dp0fo4MyGamesPath.bat > nul
  137. goto start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement