Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: UNDO Game Fixer script by AveYo, release 1.1
- :: http://dev.dota2.com/showthread.php?t=147852
- ::
- :: REVERTS GENERAL FIXES:
- :: - Hw network driver tweaks - flow control, buffers, offload processing
- :: - OS Speedguide.net tweaks - tcp/ip network improvements for gamers with extras
- :: - OS compatibility tweaks - crash reports, data collection, timeouts
- @ECHO OFF &SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
- GOTO :CHECK_OS
- :_START
- rem SET _TRACE=1
- CALL :XECHO You only need to run this script once - but harmless if run multiple times
- CALL :SECHO UNDO GENERAL FIXES
- ::::::::::::::::::::::::::
- rem CALL :INFO_DISABLE_FUNCTIONS_BY_STARTING_THE_LINE_WITH_REM_
- CALL :GEN_HW_NIC_TWEAKS
- CALL :GEN_OS_SPEEDGUIDE_TWEAKS
- CALL :GEN_OS_COMPATIBILITY_TWEAKS
- CALL :GEN_OS_VISUALFX_TWEAKS
- CALL :XDONE General fixes reverted!
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- GOTO :eof
- ::::::::::::::::::::::::::::
- :: GENERAL TWEAKS SECTION ::
- ::::::::::::::::::::::::::::
- :GEN_HW_NIC_TWEAKS
- CALL :XECHO Hw network driver tweaks - flow control, buffers, offload processing
- FOR /F "tokens=3*" %%I IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards" /F "ServiceName" /S^|FINDSTR /I /L "ServiceName"') DO (
- 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
- FOR %%n IN (#FlowControl #InterruptModeration #LsoV1IPv4 #QOS #RSS RSS #WakeOnMagicPacket #WakeOnPattern Ioac_SwoiSupported Moderate Promiscuous ShutdownWake SleepSpeed) DO SET "opt=%%n" &SET "opt=!opt:#=*!" ® DELETE "!REGPATH!" /F /V !opt! >nul 2>&1
- FOR %%m IN (#DeviceSleepOnDisconnect #LsoV2IPv4 #LsoV2IPv6 #PMARPOffload TaskOffload) DO SET "opt=%%m" &SET "opt=!opt:#=*!" ® DELETE "!REGPATH!" /F /V !opt! >nul 2>&1
- FOR %%o IN (#IPChecksumOffloadIPv4 #TCPChecksumOffloadIPv4 #TCPChecksumOffloadIPv6 #UDPChecksumOffloadIPv4 #UDPChecksumOffloadIPv6) DO SET "opt=%%o" &SET "opt=!opt:#=*!" ® DELETE "!REGPATH!" /F /V !opt! >nul 2>&1
- REG DELETE "!REGPATH!" /F /V "*JumboPacket" >nul 2>&1
- REG DELETE "!REGPATH!" /F /V "*ReceiveBuffers" >nul 2>&1
- REG DELETE "!REGPATH!" /F /V "*RSSProfile" >nul 2>&1
- REG DELETE "!REGPATH!" /F /V "*SSIdleTimeout" >nul 2>&1
- REG DELETE "!REGPATH!" /F /V "*TransmitBuffers" >nul 2>&1
- REG DELETE "!REGPATH!" /F /V "MaxInterrupt" >nul 2>&1
- )
- GOTO :eof
- ::END.GEN_HW_NIC_TWEAKS
- :GEN_OS_SPEEDGUIDE_TWEAKS
- CALL :XECHO OS Speedguide.net tweaks
- 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
- FOR %%I IN (tcp udp) DO netsh int ipv4 set dynamicport %%I start=49152 num=16384 >nul 2>&1
- FOR %%I IN (MaxNegativeCacheTtl NegativeCacheTime NegativeSOACacheTime NetFailureCacheTime) DO REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" /F /v %%I >nul 2>&1
- FOR /F "tokens=3*" %%I IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards" /F "ServiceName" /S^|FINDSTR /I /L "ServiceName"') DO (
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\%%I" /F /v MTU >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\%%I" /F /v TcpAckFrequency >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\%%I" /F /v TcpDelAckTicks >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\%%I" /F /v TCPNoDelay >nul 2>&1
- )
- REG DELETE "HKLM\SOFTWARE\Microsoft\MSMQ\Parameters" /F /v TCPNoDelay >nul 2>&1
- REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /F /v NetworkThrottlingIndex >nul 2>&1
- REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\Psched" /F /v NonBestEffortLimit >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /F /v DontVerifyRandomDrivers >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\I/O System" /F /v CountOperations >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\AFD\Parameters" /F /v IgnorePushBitOnReceives >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\AFD\Parameters" /F /v NonBlockingSendSpecialBuffering >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v DefaultTTL >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v DisableTaskOffload >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v EnableConnectionRateLimiting >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v EnableTCPA >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v EnableWsd >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v TCPMaxDataRetransmissions >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /F /v TcpTimedWaitDelay >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /F /v StrictTimeWaitSeqCheck >nul 2>&1
- FOR %%I IN (LocalPriority HostsPriority DnsPriority NetbtPriority) DO REG DELETE "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\ServiceProvider" /F /v %%I >nul 2>&1
- GOTO :eof
- ::END.GEN_OS_SPEEDGUIDE_TWEAKS
- :GEN_OS_COMPATIBILITY_TWEAKS
- CALL :XECHO OS compatibility tweaks - crash, data collection, timeouts
- REG DELETE "HKCU\Control Panel\Desktop" /F /v ForegroundLockTimeout >nul 2>&1
- REG DELETE "HKCU\Control Panel\Desktop" /F /v HungAppTimeout >nul 2>&1
- REG DELETE "HKCU\Control Panel\Desktop" /F /v LowLevelHooksTimeout >nul 2>&1
- REG DELETE "HKCU\Control Panel\Desktop" /F /v WaitToKillAppTimeout >nul 2>&1
- REG DELETE "HKCU\Software\Microsoft\InputPersonalization" /F /v RestrictImplicitInkCollection >nul 2>&1
- REG DELETE "HKCU\Software\Microsoft\InputPersonalization" /F /v RestrictImplicitTextCollection >nul 2>&1
- REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\App Management" /F /v COMClassStore >nul 2>&1
- REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\AppHost" /F /v EnableWebContentEvaluation >nul 2>&1
- REG DELETE "HKCU\Software\Policies\Microsoft\Windows\AppCompat" /F /v DisablePCA >nul 2>&1
- REG DELETE "HKCU\Software\Policies\Microsoft\Windows\EdgeUI" /F /v DisableMFUTracking >nul 2>&1
- REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "GPU Priority" >nul 2>&1
- REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "Priority" >nul 2>&1
- REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "Scheduling Category" >nul 2>&1
- REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "SFIO Priority" >nul 2>&1
- REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /F /v CrashDumpEnabled >nul 2>&1
- REG DELETE "HKLM\SYSTEM\ControlSet001\Control\CrashControl" /F /v CrashDumpEnabled >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\PriorityControl" /F /v IRQ8Priority >nul 2>&1
- REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /F /v "DisablePagingExecutive" >nul 2>&1
- GOTO :eof
- ::END.GEN_OS_COMPATIBILITY_TWEAKS
- :GEN_OS_VISUALFX_TWEAKS
- CALL :XECHO OS visual fx tweaks - less animations
- REG DELETE "HKCU\Control Panel\Desktop\WindowMetrics" /F /v VisualFXSetting >nul 2>&1
- REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /F /v VisualFXSetting >nul 2>&1
- REG DELETE "HKCU\Control Panel\Desktop" /F /v UserPreferencesMask >nul 2>&1
- 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
- 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
- REG DELETE "HKCU\Control Panel\Desktop\WindowMetrics" /F /v MinAnimate >nul 2>&1
- REG DELETE "HKCU\Software\Microsoft\Windows\DWM" /F /v Max3DWindows >nul 2>&1
- GOTO :eof
- ::END.GEN_OS_VISUALFX_TWEAKS
- ::::::::::::::::::::::::::::::::::::::
- :: BATCH SCRIPT INTERNAL FUNCTIONS ::
- ::::::::::::::::::::::::::::::::::::::
- :XDONE
- echo/
- echo/===========================================================
- echo/DONE: %*
- echo/
- IF DEFINED _TRACE echo Press any key to quit &PAUSE >nul &EXIT
- PING -n 16 127.0.0.1 >nul 2>&1 &EXIT
- GOTO :eof
- ::END.XDONE
- :XERR
- CLS
- echo/
- echo/ERROR: %*
- PAUSE
- IF NOT DEFINED _TRACE EXIT
- GOTO :eof
- ::END.XERR
- :XECHO
- echo/
- IF NOT "%1_"=="_" echo/%_nline%:%*
- IF DEFINED _TRACE echo/ &PAUSE
- SET /A _nline+=1
- GOTO :eof
- ::END.XECHO
- :SECHO
- echo/
- IF NOT "%1_"=="_" echo/===========================================================
- IF NOT "%1_"=="_" echo/ %*
- IF NOT "%1_"=="_" echo/===========================================================
- SET /A _nline=1
- GOTO :eof
- ::END.SECHO
- :TRIM
- :: CALL :TRIM variablename
- SETLOCAL ENABLEDELAYEDEXPANSION &CALL SET _STR=%%%1%%
- SET _STR=%_STR:!=$1#%
- SET _STR=%_STR:^=$6#%
- CALL :TRIM_STR
- ENDLOCAL &SET _STR=%_STR%
- SET _STR=%_STR:$1#=!%
- SET _STR=%_STR:$6#=^%
- SET %1=%_STR%
- GOTO :eof
- :TRIM_STR
- IF "!_STR:~-1!"==" " SET "_STR=!_STR:~0,-1!" & GOTO :TRIM_STR
- IF "!_STR:~0,1!"==" " SET "_STR=!_STR:~1,-1!!_STR:~-1!" & GOTO :TRIM_STR
- GOTO :eof
- ::END.TRIM
- :CHECK_OS
- :: Usage: GOTO :CHECK_OS [This must run first after @ECHO OFF]
- SET _MYVER=1.0
- SET "SSVAR=%WINDIR%\SYSTEM32"
- SET "PFVAR=%PROGRAMFILES%"
- IF DEFINED ProgramW6432 SET "PFVAR=%ProgramW6432%"
- IF DEFINED PROCESSOR_ARCHITEW6432 SET "SSVAR=%WINDIR%\Sysnative"
- )
- COLOR 70 &SET _LABEL=%~n0 by a^v^ey^o^ v%_MYVER%
- FOR /F "tokens=4-5 delims=. " %%i IN ('ver') DO SET WINVERSION=%%i%%j
- :: filter OS
- IF %WINVERSION% LEQ 60 CALL :ERR ONLY FOR WINDOWS 7 OR ABOVE
- :: test rights
- REG ADD "HKLM\SYSTEM\CurrentControlSET\Control\Session Manager\Environment" /F /v TESTRUNAS /t REG_SZ /d 1 >nul 2>&1
- IF NOT ERRORLEVEL 1 SET "ISRUNAS=Y"
- CLS &echo. &TITLE %_LABEL%
- REG DELETE "HKLM\SYSTEM\CurrentControlSET\Control\Session Manager\Environment" /F /v TESTRUNAS >nul 2>&1
- :: stop if dota.exe running
- FOR /F "tokens=1*" %%I IN ('tasklist /FI "IMAGENAME eq dota.exe" /NH') DO SET "CHECKRUN=%%I"
- IF [%CHECKRUN%]==[dota.exe] CALL :XERR Close Dota before running this script {won't do it for you}
- PUSHD "%~dp0"
- IF "%1"=="_SELF_ADMIN" SHIFT &SHIFT &goto :_START
- IF DEFINED ISRUNAS goto :_START
- IF NOT DEFINED ISRUNAS CALL :XECHO Requesting admin rights, if it fails, R-click and 'Run As Administrator'
- echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\~1337run.vbs"
- echo UAC.ShellExecute "%~s0", "_SELF_ADMIN %~s0 %*", "", "runas", 1 >> "%temp%\~1337run.vbs"
- CALL %SSVAR%\CSCRIPT.EXE //nologo "%temp%\~1337run.vbs" &DEL /F /Q "%temp%\~1337run.vbs" &EXIT /B
- GOTO :eof
- ::END.CHECK_OS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement