Advertisement
aveyo

gamefixer_undo_general_fixes.bat - outdated!

Oct 29th, 2014
813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Winbatch 11.15 KB | None | 0 0
  1. :: UNDO Game Fixer script by AveYo, release 1.1
  2. :: http://dev.dota2.com/showthread.php?t=147852
  3. ::
  4. :: REVERTS GENERAL FIXES:
  5. :: - Hw network driver tweaks - flow control, buffers, offload processing
  6. :: - OS Speedguide.net tweaks - tcp/ip network improvements for gamers with extras
  7. :: - OS compatibility tweaks - crash reports, data collection, timeouts
  8.  
  9. @ECHO OFF &SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  10. GOTO :CHECK_OS
  11. :_START
  12. rem SET _TRACE=1
  13.  
  14. CALL :XECHO You only need to run this script once - but harmless if run multiple times
  15.  
  16. CALL :SECHO UNDO GENERAL FIXES
  17. ::::::::::::::::::::::::::
  18. rem CALL :INFO_DISABLE_FUNCTIONS_BY_STARTING_THE_LINE_WITH_REM_
  19. CALL :GEN_HW_NIC_TWEAKS
  20. CALL :GEN_OS_SPEEDGUIDE_TWEAKS
  21. CALL :GEN_OS_COMPATIBILITY_TWEAKS
  22. CALL :GEN_OS_VISUALFX_TWEAKS
  23.  
  24. CALL :XDONE General fixes reverted!
  25. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  26. GOTO :eof
  27.  
  28.  
  29.  
  30.    
  31. ::::::::::::::::::::::::::::
  32. :: GENERAL TWEAKS SECTION ::
  33. ::::::::::::::::::::::::::::
  34.  
  35. :GEN_HW_NIC_TWEAKS
  36. CALL :XECHO Hw network driver tweaks - flow control, buffers, offload processing
  37. FOR /F "tokens=3*" %%I IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards" /F "ServiceName" /S^|FINDSTR /I /L "ServiceName"') DO (
  38. FOR /F %%A IN ('REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}" /F "%%I" /D /E /S ^|FINDSTR /I /L /V "Linkage"^|FINDSTR /I /L "\\Class\\"') DO SET "REGPATH=%%A" >nul 2>&1
  39. FOR %%n IN (#FlowControl #InterruptModeration #LsoV1IPv4 #QOS #RSS RSS #WakeOnMagicPacket #WakeOnPattern Ioac_SwoiSupported Moderate Promiscuous ShutdownWake SleepSpeed) DO SET "opt=%%n" &SET "opt=!opt:#=*!" &REG DELETE "!REGPATH!" /F /V !opt! >nul 2>&1
  40. FOR %%m IN (#DeviceSleepOnDisconnect #LsoV2IPv4 #LsoV2IPv6 #PMARPOffload TaskOffload) DO SET "opt=%%m" &SET "opt=!opt:#=*!" &REG DELETE "!REGPATH!" /F /V !opt! >nul 2>&1
  41. FOR %%o IN (#IPChecksumOffloadIPv4 #TCPChecksumOffloadIPv4 #TCPChecksumOffloadIPv6 #UDPChecksumOffloadIPv4 #UDPChecksumOffloadIPv6) DO SET "opt=%%o" &SET "opt=!opt:#=*!" &REG DELETE "!REGPATH!" /F /V !opt! >nul 2>&1
  42. REG DELETE "!REGPATH!" /F /V "*JumboPacket" >nul 2>&1
  43. REG DELETE "!REGPATH!" /F /V "*ReceiveBuffers" >nul 2>&1
  44. REG DELETE "!REGPATH!" /F /V "*RSSProfile" >nul 2>&1
  45. REG DELETE "!REGPATH!" /F /V "*SSIdleTimeout" >nul 2>&1
  46. REG DELETE "!REGPATH!" /F /V "*TransmitBuffers" >nul 2>&1
  47. REG DELETE "!REGPATH!" /F /V "MaxInterrupt" >nul 2>&1
  48. )
  49. GOTO :eof
  50. ::END.GEN_HW_NIC_TWEAKS
  51.  
  52. :GEN_OS_SPEEDGUIDE_TWEAKS
  53. CALL :XECHO OS Speedguide.net tweaks
  54. NETSH int tcp set heuristics enabled &FOR %%I IN ("autotuninglevel=normal" "chimney=default" "congestionprovider=default" "netdma=disabled" "rss=default") DO NETSH int tcp set global %%~I >nul 2>&1
  55. FOR %%I IN (tcp udp) DO netsh int ipv4 set dynamicport %%I start=49152 num=16384 >nul 2>&1
  56. FOR %%I IN (MaxNegativeCacheTtl NegativeCacheTime NegativeSOACacheTime NetFailureCacheTime) DO REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" /F /v %%I >nul 2>&1
  57. FOR /F "tokens=3*" %%I IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards" /F "ServiceName" /S^|FINDSTR /I /L "ServiceName"') DO (
  58. REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\%%I" /F /v MTU >nul 2>&1
  59. REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\%%I" /F /v TcpAckFrequency >nul 2>&1
  60. REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\%%I" /F /v TcpDelAckTicks >nul 2>&1
  61. REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\%%I" /F /v TCPNoDelay >nul 2>&1
  62. )
  63. REG DELETE "HKLM\SOFTWARE\Microsoft\MSMQ\Parameters" /F /v TCPNoDelay >nul 2>&1
  64. REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /F /v NetworkThrottlingIndex >nul 2>&1
  65. REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\Psched" /F /v NonBestEffortLimit >nul 2>&1
  66. REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /F /v DontVerifyRandomDrivers >nul 2>&1
  67. REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\I/O System" /F /v CountOperations >nul 2>&1
  68. REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\AFD\Parameters" /F /v IgnorePushBitOnReceives >nul 2>&1
  69. REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\AFD\Parameters" /F /v NonBlockingSendSpecialBuffering >nul 2>&1
  70. REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v DefaultTTL >nul 2>&1
  71. REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v DisableTaskOffload >nul 2>&1
  72. REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v EnableConnectionRateLimiting >nul 2>&1
  73. REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v EnableTCPA >nul 2>&1
  74. REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v EnableWsd >nul 2>&1
  75. REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v TCPMaxDataRetransmissions >nul 2>&1
  76. REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /F /v TcpTimedWaitDelay >nul 2>&1
  77. REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /F /v StrictTimeWaitSeqCheck >nul 2>&1
  78. FOR %%I IN (LocalPriority HostsPriority DnsPriority NetbtPriority) DO REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\ServiceProvider" /F /v %%I >nul 2>&1
  79. GOTO :eof
  80. ::END.GEN_OS_SPEEDGUIDE_TWEAKS
  81.  
  82. :GEN_OS_COMPATIBILITY_TWEAKS
  83. CALL :XECHO OS compatibility tweaks - crash, data collection, timeouts
  84. REG DELETE "HKCU\Control Panel\Desktop" /F /v ForegroundLockTimeout >nul 2>&1
  85. REG DELETE "HKCU\Control Panel\Desktop" /F /v HungAppTimeout >nul 2>&1
  86. REG DELETE "HKCU\Control Panel\Desktop" /F /v LowLevelHooksTimeout >nul 2>&1
  87. REG DELETE "HKCU\Control Panel\Desktop" /F /v WaitToKillAppTimeout >nul 2>&1
  88. REG DELETE "HKCU\Software\Microsoft\InputPersonalization" /F /v RestrictImplicitInkCollection >nul 2>&1
  89. REG DELETE "HKCU\Software\Microsoft\InputPersonalization" /F /v RestrictImplicitTextCollection >nul 2>&1
  90. REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\App Management" /F /v COMClassStore >nul 2>&1
  91. REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\AppHost" /F /v EnableWebContentEvaluation >nul 2>&1
  92. REG DELETE "HKCU\Software\Policies\Microsoft\Windows\AppCompat" /F /v DisablePCA >nul 2>&1
  93. REG DELETE "HKCU\Software\Policies\Microsoft\Windows\EdgeUI" /F /v DisableMFUTracking >nul 2>&1
  94. REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "GPU Priority" >nul 2>&1
  95. REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "Priority" >nul 2>&1
  96. REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "Scheduling Category" >nul 2>&1
  97. REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "SFIO Priority" >nul 2>&1
  98. REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /F /v CrashDumpEnabled >nul 2>&1
  99. REG DELETE "HKLM\SYSTEM\ControlSet001\Control\CrashControl" /F /v CrashDumpEnabled >nul 2>&1
  100. REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\PriorityControl" /F /v IRQ8Priority >nul 2>&1
  101. REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /F /v "DisablePagingExecutive" >nul 2>&1
  102. GOTO :eof
  103. ::END.GEN_OS_COMPATIBILITY_TWEAKS
  104.  
  105. :GEN_OS_VISUALFX_TWEAKS
  106. CALL :XECHO OS visual fx tweaks - less animations
  107. REG DELETE "HKCU\Control Panel\Desktop\WindowMetrics" /F /v VisualFXSetting >nul 2>&1
  108. REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /F /v VisualFXSetting >nul 2>&1
  109. REG DELETE "HKCU\Control Panel\Desktop" /F /v UserPreferencesMask >nul 2>&1
  110. FOR %%I IN (CompositionPolicy ListBoxSmoothScrolling TooltipAnimation TaskbarAnimations SelectionFade MenuAnimation ListviewWatermark ListviewShadow ListviewAlphaSelect DropShadow CursorShadow ControlAnimations ComboBoxAnimation AnimateMinMax) DO REG DELETE "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\%%I" /F /v DefaultApplied >nul 2>&1
  111. rem FOR %%I IN (ThumbnailsOrIcon Themes FontSmoothing DragFullWindows) DO REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\%%I" /F /v DefaultApplied /T REG_DWORD /D 1 >nul 2>&1
  112. REG DELETE "HKCU\Control Panel\Desktop\WindowMetrics" /F /v MinAnimate >nul 2>&1
  113. REG DELETE "HKCU\Software\Microsoft\Windows\DWM" /F /v Max3DWindows >nul 2>&1
  114. GOTO :eof
  115. ::END.GEN_OS_VISUALFX_TWEAKS
  116.  
  117.  
  118.  
  119.  
  120.  
  121. ::::::::::::::::::::::::::::::::::::::
  122. :: BATCH SCRIPT INTERNAL FUNCTIONS  ::
  123. ::::::::::::::::::::::::::::::::::::::
  124.  
  125. :XDONE
  126. echo/
  127. echo/===========================================================
  128. echo/DONE: %*
  129. echo/
  130. IF DEFINED _TRACE echo Press any key to quit &PAUSE >nul &EXIT
  131. PING -n 16 127.0.0.1 >nul 2>&1 &EXIT
  132. GOTO :eof
  133. ::END.XDONE
  134.  
  135. :XERR
  136. CLS
  137. echo/
  138. echo/ERROR: %*
  139. PAUSE
  140. IF NOT DEFINED _TRACE EXIT
  141. GOTO :eof
  142. ::END.XERR
  143.  
  144. :XECHO
  145. echo/
  146. IF NOT "%1_"=="_" echo/%_nline%:%*
  147. IF DEFINED _TRACE echo/ &PAUSE
  148. SET /A _nline+=1
  149. GOTO :eof
  150. ::END.XECHO
  151.  
  152. :SECHO
  153. echo/
  154. IF NOT "%1_"=="_" echo/===========================================================
  155. IF NOT "%1_"=="_" echo/   %*
  156. IF NOT "%1_"=="_" echo/===========================================================
  157. SET /A _nline=1
  158. GOTO :eof
  159. ::END.SECHO
  160.  
  161. :TRIM
  162. :: CALL :TRIM variablename
  163. SETLOCAL ENABLEDELAYEDEXPANSION &CALL SET _STR=%%%1%%
  164. SET _STR=%_STR:!=$1#%
  165. SET _STR=%_STR:^=$6#%
  166. CALL :TRIM_STR
  167. ENDLOCAL &SET _STR=%_STR%
  168. SET _STR=%_STR:$1#=!%
  169. SET _STR=%_STR:$6#=^%
  170. SET %1=%_STR%
  171. GOTO :eof
  172. :TRIM_STR
  173. IF "!_STR:~-1!"==" " SET "_STR=!_STR:~0,-1!" & GOTO :TRIM_STR
  174. IF "!_STR:~0,1!"==" " SET "_STR=!_STR:~1,-1!!_STR:~-1!" & GOTO :TRIM_STR
  175. GOTO :eof
  176. ::END.TRIM
  177.  
  178. :CHECK_OS
  179. :: Usage: GOTO :CHECK_OS [This must run first after @ECHO OFF]
  180. SET _MYVER=1.0
  181. SET "SSVAR=%WINDIR%\SYSTEM32"
  182. SET "PFVAR=%PROGRAMFILES%"
  183. IF DEFINED ProgramW6432 SET "PFVAR=%ProgramW6432%"
  184. IF DEFINED PROCESSOR_ARCHITEW6432 SET "SSVAR=%WINDIR%\Sysnative"
  185. )
  186. COLOR 70 &SET _LABEL=%~n0 by a^v^ey^o^ v%_MYVER%
  187. FOR /F "tokens=4-5 delims=. " %%i IN ('ver') DO SET WINVERSION=%%i%%j
  188. :: filter OS
  189. IF %WINVERSION% LEQ 60 CALL :ERR ONLY FOR WINDOWS 7 OR ABOVE
  190. :: test rights
  191. REG ADD "HKLM\SYSTEM\CurrentControlSET\Control\Session Manager\Environment" /F /v TESTRUNAS /t REG_SZ /d 1 >nul 2>&1
  192. IF NOT ERRORLEVEL 1 SET "ISRUNAS=Y"
  193. CLS &echo. &TITLE %_LABEL%
  194. REG DELETE "HKLM\SYSTEM\CurrentControlSET\Control\Session Manager\Environment" /F /v TESTRUNAS >nul 2>&1
  195. :: stop if dota.exe running
  196. FOR /F "tokens=1*" %%I IN ('tasklist /FI "IMAGENAME eq dota.exe" /NH') DO SET "CHECKRUN=%%I"
  197. IF [%CHECKRUN%]==[dota.exe] CALL :XERR Close Dota before running this script {won't do it for you}
  198. PUSHD "%~dp0"
  199. IF "%1"=="_SELF_ADMIN" SHIFT &SHIFT &goto :_START
  200. IF DEFINED ISRUNAS goto :_START
  201. IF NOT DEFINED ISRUNAS CALL :XECHO Requesting admin rights, if it fails, R-click and 'Run As Administrator'
  202. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\~1337run.vbs"
  203. echo UAC.ShellExecute "%~s0", "_SELF_ADMIN %~s0 %*", "", "runas", 1 >> "%temp%\~1337run.vbs"
  204. CALL %SSVAR%\CSCRIPT.EXE //nologo "%temp%\~1337run.vbs" &DEL /F /Q "%temp%\~1337run.vbs" &EXIT /B
  205. GOTO :eof
  206. ::END.CHECK_OS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement