Advertisement
dubbyOW

BCDEditTweaks

Jun 30th, 2024 (edited)
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 5.52 KB | Source Code | 0 0
  1. @echo off
  2. color 87
  3. title BCDEdit Tweaks Manager
  4. mode con: cols=70 lines=25
  5.  
  6. :menu
  7. cls
  8. echo ===============================================================
  9. echo                      BCDEdit Tweaks Manager                    
  10. echo ===============================================================
  11. echo.
  12. echo Please choose an option:
  13. echo [1] Apply All BCDEdit Tweaks  (Performance + Compatibility)
  14. echo [2] Apply Safe BCDEdit Tweaks (Zero Security Risk)
  15. echo [3] Reset All Settings to Default
  16. echo [4] Exit
  17. echo.
  18. echo Type 1, 2, 3, or 4 based on your choice and press Enter.
  19. set /p choice="Answer: "
  20.  
  21. if "%choice%"=="1" (
  22.     goto applyAllTweaks
  23. ) else if "%choice%"=="2" (
  24.     goto applySafeTweaks
  25. ) else if "%choice%"=="3" (
  26.     goto resetToDefault
  27. ) else if "%choice%"=="4" (
  28.     exit
  29. ) else (
  30.     echo.
  31.     echo Invalid choice. Please try again.
  32.     timeout /t 2 >nul
  33.     goto menu
  34. )
  35.  
  36. :applyAllTweaks
  37. cls
  38. echo ===============================================================
  39. echo                 Applying All BCDEdit Tweaks...                  
  40. echo ===============================================================
  41. echo.
  42. echo [SAFE] Applying disabledynamictick...
  43. call :applyTweak "bcdedit /set disabledynamictick yes"
  44.  
  45. echo [SAFE] Applying useplatformtick...
  46. call :applyTweak "bcdedit /set useplatformtick yes"
  47.  
  48. echo Applying usefirmwarepcisettings...
  49. call :applyTweak "bcdedit /set usefirmwarepcisettings no"
  50.  
  51. echo [SAFE] Applying tscsyncpolicy...
  52. call :applyTweak "bcdedit /set tscsyncpolicy enhanced"
  53.  
  54. echo [SAFE] Applying uselegacyapicmode...
  55. call :applyTweak "bcdedit /set uselegacyapicmode no"
  56.  
  57. echo [SAFE] Applying usephysicaldestination...
  58. call :applyTweak "bcdedit /set usephysicaldestination no"
  59.  
  60. echo Applying tpmbootentropy...
  61. call :applyTweak "bcdedit /set tpmbootentropy ForceDisable"
  62.  
  63. echo Applying bootux...
  64. call :applyTweak "bcdedit /set bootux Disabled"
  65.  
  66. echo Applying loadoptions...
  67. call :applyTweak "bcdedit /set loadoptions DDISABLE_INTEGRITY_CHECKS"
  68.  
  69. echo Applying nointegritychecks...
  70. call :applyTweak "bcdedit /set nointegritychecks Yes"
  71.  
  72. echo Applying testsigning...
  73. call :applyTweak "bcdedit /set testsigning No"
  74.  
  75. echo [SAFE] Applying hypervisorlaunchtype...
  76. call :applyTweak "bcdedit /set hypervisorlaunchtype off"
  77.  
  78. echo Applying nx...
  79. call :applyTweak "bcdedit /set nx AlwaysOff"
  80.  
  81. echo.
  82. echo All tweaks applied successfully.
  83. echo NOTE: Some tweaks have security implications. Use with caution.
  84. echo.
  85. echo A system restart is required for changes to take effect.
  86. goto end
  87.  
  88. :applySafeTweaks
  89. cls
  90. echo ===============================================================
  91. echo                Applying Safe BCDEdit Tweaks...                  
  92. echo ===============================================================
  93. echo.
  94. echo [SAFE] Applying disabledynamictick...
  95. call :applyTweak "bcdedit /set disabledynamictick yes"
  96.  
  97. echo [SAFE] Applying useplatformtick...
  98. call :applyTweak "bcdedit /set useplatformtick yes"
  99.  
  100. echo [SAFE] Applying tscsyncpolicy...
  101. call :applyTweak "bcdedit /set tscsyncpolicy enhanced"
  102.  
  103. echo [SAFE] Applying uselegacyapicmode...
  104. call :applyTweak "bcdedit /set uselegacyapicmode no"
  105.  
  106. echo [SAFE] Applying usephysicaldestination...
  107. call :applyTweak "bcdedit /set usephysicaldestination no"
  108.  
  109. echo [SAFE] Applying hypervisorlaunchtype...
  110. call :applyTweak "bcdedit /set hypervisorlaunchtype off"
  111.  
  112. echo.
  113. echo All safe tweaks applied successfully.
  114. echo These tweaks pose zero security risk to your system.
  115. echo.
  116. echo A system restart is required for changes to take effect.
  117. goto end
  118.  
  119. :resetToDefault
  120. cls
  121. echo ===============================================================
  122. echo             Restoring BCDEdit Parameters to Default...          
  123. echo ===============================================================
  124. echo.
  125. echo Restoring disabledynamictick...
  126. call :restoreDefault "bcdedit /deletevalue disabledynamictick"
  127.  
  128. echo Restoring useplatformtick...
  129. call :restoreDefault "bcdedit /deletevalue useplatformtick"
  130.  
  131. echo Restoring usefirmwarepcisettings...
  132. call :restoreDefault "bcdedit /deletevalue usefirmwarepcisettings"
  133.  
  134. echo Restoring tscsyncpolicy...
  135. call :restoreDefault "bcdedit /deletevalue tscsyncpolicy"
  136.  
  137. echo Restoring uselegacyapicmode...
  138. call :restoreDefault "bcdedit /deletevalue uselegacyapicmode"
  139.  
  140. echo Restoring usephysicaldestination...
  141. call :restoreDefault "bcdedit /deletevalue usephysicaldestination"
  142.  
  143. echo Restoring tpmbootentropy...
  144. call :restoreDefault "bcdedit /deletevalue tpmbootentropy"
  145.  
  146. echo Restoring bootux...
  147. call :restoreDefault "bcdedit /deletevalue bootux"
  148.  
  149. echo Restoring loadoptions...
  150. call :restoreDefault "bcdedit /deletevalue loadoptions"
  151.  
  152. echo Restoring nointegritychecks...
  153. call :restoreDefault "bcdedit /deletevalue nointegritychecks"
  154.  
  155. echo Restoring testsigning...
  156. call :restoreDefault "bcdedit /deletevalue testsigning"
  157.  
  158. echo Restoring hypervisorlaunchtype...
  159. call :restoreDefault "bcdedit /deletevalue hypervisorlaunchtype"
  160.  
  161. echo Restoring nx to OptIn...
  162. call :restoreDefault "bcdedit /set nx OptIn"
  163.  
  164. echo.
  165. echo All parameters restored to default values.
  166. echo.
  167. echo A system restart is required for changes to take effect.
  168. goto end
  169.  
  170. :applyTweak
  171. %~1 >nul 2>&1
  172. if errorlevel 1 (
  173.     echo Failed: %~1
  174. ) else (
  175.     echo Success!
  176. )
  177. goto:eof
  178.  
  179. :restoreDefault
  180. %~1 >nul 2>&1
  181. if errorlevel 1 (
  182.     echo Failed: %~1
  183. ) else (
  184.     echo Success!
  185. )
  186. goto:eof
  187.  
  188. :end
  189. echo.
  190. echo ===============================================================
  191. echo Press any key to return to the menu...
  192. pause >nul
  193. goto menu
  194.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement