Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Game Fixer script by AveYo, release 1.4b - Dota Brute Force Anti Crashing
- :: http://dev.dota2.com/showthread.php?t=147852
- ::
- :: Changelog:
- :: v1.1: fixed dota detection for those with custom steam library that did never run dota manually
- :: v1.1b: fixed Valve's latest update forbidding custom launch options shortcuts to dota.exe (switched to steam -applaunch)
- :: v1.2: less drastical vpk override cleanup - if Verify integrity does not complete some were missing sounds
- :: fixed some speedguide tweaks not being applied
- :: v1.3: changed launch options for the now 4 troubleshooting shortcuts and activated some autoexec.cfg engine tweaks;
- :: test removing existing Steam launch options(not needed before the 1.1b change forced by Valve)
- :: test altering other Steam settings - no notifications, disable steam overlay, disable streaming, disable steam cloud
- :: v1.4: revised launch options: added hwsync tests, windowed(with border) tests - 14 troubleshooting shortcuts available now!
- :: autoset advanced video options - decent-looking minimal preset - high textures, high shadows, 90% renderer, global lights, animate portrait
- :: fix rare bug with Steam installed in %COMMONPROGRAMFILES% or %COMMONPROGRAMFILES(X86)% being removed by previous script
- :: v1.4b: finalized steam optimization settings that was added as a test in v1.3; disable downloads during gameplay added
- :: optimized order of execution, add 2 minutes timeout to wait functions. almost 1000 lines count :D
- ::
- :: GENERAL FIXES:
- :: - Crash at the PLAY menu because user has a Bigfoot Killer Network Adaptor.
- :: fix: disable bandwidth control - I don't have such card but I am confident it will succeed.
- :: - Crash at the PLAY menu or at loading because user has AMD Quickstream enabled.
- :: fix: disable apex virtual adapter that is very similar in function to Killer's bandwidth control.
- :: - Network issues and even crashes because of FlowControl etc. enabled in network driver.
- :: fix: disable FlowControl, InterruptModeration and activate proper checksum offloading.
- :: - Bad network performance when packet loss happens - and it does happen almost every game in the last two months.
- :: fix: implemented Speedguide.net tweaks with my own extra fixes.
- :: - Various os compatibility issues leading to poor performance or crashes.
- :: fix: restore app timeouts so dota won't get killed early, give priority to gaming, enable crash reports, disable data collection & PCA.
- :: - Undo tweaks available here. For Killer and Quickstream, undo by reinstallation.
- ::
- :: DOTA SPECIFIC FIXES:
- :: - Attempt to remove run-as-admin compatibility for dota.exe to fix most crash-to-desktop's with scaleformui_4.Dll exception.
- :: - Fix audio stutter and slugginess in main menu: remove animated background, use sound engine tweaks for onboard audio device.
- :: - Optimize video options with decent-looking minimal preset safe to use as a starting point, and fix rare miss-configuration of gpu features.
- :: - Optimize network settings for the current server status: slow tickrate, lagging, packet loss, deficient interpolation.
- :: - Optimize other dota autoexec.cfg cvars, existing cfg renamed to personal.cfg and autoloaded, this way filtering "bad" settings.
- :: - Optimize some steam preferences: notifications, steam overlay, streaming, steam cloud or downloads during gameplay.
- :: - Force repair of steam client service on the next run, it really needs to be set up properly if UAC is active.
- :: - Cleanup crash dumps so new ones are easier to spot (record comes from a user that found 2000+ steam crashdumps!!).
- :: - Remove custom client mods (-override_vpk) after backing them up into dota\backup folder.
- :: - Launch verify integrity of game cache to fix most game file missmatch issues after a patch [wait for it to finish!].
- :: - Generate troubleshooting dota shortcuts with custom launch options for displaymode (windowed / windowedfs / noborder / fullscreen),
- :: d3d (d3d9ex / nod3d9ex), hwsync (0/1), matqueue (-1/0/1/2)... so that dota might start even with bad drivers/old gpus.
- :: - Workaround for a Valve bug: you cannot switch between windowed and noborder using just launch options, so i've added two enable scripts.
- :: By default noborder is active and is preffered, activate the windowed mode only in case of issues (not starting).
- @ECHO OFF &SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
- GOTO :CHECK_OS
- :_START
- rem SET _TRACE=1
- CALL :XECHO You only need to run this once - but harmless if run multiple times
- CALL :XTITLE GENERAL FIXES
- ::::::::::::::::::::::::::
- rem CALL :INFO_DISABLE_FUNCTIONS_BY_STARTING_THE_LINE_WITH_REM_AND_KEEP_DEFAULT_ORDER
- CALL :GEN_KILLER_BC_DISABLER
- CALL :GEN_AMD_APEX_QUICKSTREAM_DISABLER
- CALL :GEN_HW_NIC_TWEAKS
- CALL :GEN_OS_SPEEDGUIDE_TWEAKS
- CALL :GEN_OS_COMPATIBILITY_TWEAKS
- CALL :GEN_OS_VISUALFX_TWEAKS
- CALL :XTITLE DOTA FIXES
- ::::::::::::::::::::::::::
- CALL :DOTA_DETECT_PATHS
- CALL :XECHO Create Desktop\Dota 2 Test shortcuts\ with troubleshooting modes
- :: Info shortcutname displaymode(windowed/windowedfs/noborder/fullscreen) d3d(d3d9ex/nod3d9ex) hwsync(0/1) matqueue(-1/0/1/2) threaded(0/1) vsync(0/1)
- CALL :DOTA_CREATE_TEST_SHORTCUT test1a windowed nod3d9ex 0 0 0 0
- CALL :DOTA_CREATE_TEST_SHORTCUT test1b windowed nod3d9ex 1 -1 0 0
- CALL :DOTA_CREATE_TEST_SHORTCUT test2a windowed d3d9ex 0 0 0 0
- CALL :DOTA_CREATE_TEST_SHORTCUT test2b windowed d3d9ex 1 -1 0 0
- CALL :DOTA_CREATE_TEST_SHORTCUT TEST2C windowedfs d3d9ex 1 -1 0 0
- CALL :DOTA_CREATE_TEST_SHORTCUT test3a noborder nod3d9ex 0 0 0 0
- CALL :DOTA_CREATE_TEST_SHORTCUT TEST3B noborder nod3d9ex 1 -1 0 0
- CALL :DOTA_CREATE_TEST_SHORTCUT test4a noborder d3d9ex 0 0 0 0
- CALL :DOTA_CREATE_TEST_SHORTCUT test4b noborder d3d9ex 1 1 0 0
- CALL :DOTA_CREATE_TEST_SHORTCUT TEST4C noborder d3d9ex 1 2 1 0
- CALL :DOTA_CREATE_TEST_SHORTCUT test5a fullscreen d3d9ex 0 0 0 0
- CALL :DOTA_CREATE_TEST_SHORTCUT test5b fullscreen d3d9ex 1 1 0 0
- CALL :DOTA_CREATE_TEST_SHORTCUT TEST5C fullscreen d3d9ex 1 2 1 0
- CALL :DOTA_CREATE_TEST_SHORTCUT test5d fullscreen d3d9ex 1 2 1 1
- CALL :DOTA_CREATE_TEST_WINDOWED_NOBORDER_TOGGLE
- CALL :DOTA_CREATE_AUTOEXEC
- CALL :DOTA_FIX_PERMISSIONS
- CALL :DOTA_STEAM_SERVICE
- CALL :DOTA_OPTIMIZE_STEAM
- CALL :DOTA_OPTIMIZE_GAME
- CALL :DOTA_CLEANUP_DUMPS
- CALL :DOTA_REMOVE_VPKMODS_FORCES_VERIFY
- CALL :XECHO Try the Dota 2 Test shortcuts in Desktop folder
- CALL :XECHO Test shortcuts naming: a=safe b=fair c=optimal d=special[vsync]
- CALL :XECHO Windowed tests require launching coresponding enable script [Valve bug]
- CALL :XDONE autoclose in 20s, but verifying integrity of game cache continues
- CD /D "%~dp0"
- GOTO :eof
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::::::::::::::::::::::::::::
- :: GENERAL TWEAKS SECTION ::
- ::::::::::::::::::::::::::::
- :GEN_KILLER_BC_DISABLER
- CALL :XECHO Killer BandwidthControl disabler
- ::1. disable gaming mode
- kstat -g 0 >nul 2>&1
- xstat -d >nul 2>&1
- ::2. stop and uninstall bandwidth control service
- TASKKILL /IM "KillerNetManager.exe" >nul 2>&1
- SC stop "Qualcomm Atheros Killer Service" >nul 2>&1
- NET stop "Qualcomm Atheros Killer Service" >nul 2>&1
- SC delete "Qualcomm Atheros Killer Service" >nul 2>&1
- SC stop "Bigfoot Networks Killer Service" >nul 2>&1
- NET stop "Bigfoot Networks Killer Service" >nul 2>&1
- SC delete "Bigfoot Networks Killer Service" >nul 2>&1
- NET stop BfLwf >nul 2>&1
- SC stop BfLwf >nul 2>&1
- IF EXIST "%PROGRAMFILES(X86)%" CD /D "%PROGRAMFILES(X86)%" >nul 2>&1
- IF EXIST "%PROGRAMFILES(X86)%" FOR /f "tokens=1* delims=/ eol=?" %%I IN ('DIR /-b/-s BFNSer*.exe^|FINDSTR /l ":"^|FINDSTR /l /v "^ & %% !!"') DO SET "KILLERPATH=%%~dpI"
- IF DEFINED KILLERPATH START "" "%KILLERPATH%\BFNService.exe" -k >nul 2>&1
- IF DEFINED KILLERPATH RMDIR /S /Q "%KILLERPATH%\bflwf" >nul 2>&1
- IF DEFINED KILLERPATH START "" "%KILLERPATH%\BFNService.exe" -u >nul 2>&1
- CD /D "%PFVAR%" >nul 2>&1
- FOR /f "tokens=1* delims=/ eol=?" %%I IN ('DIR /-b/-s BFNSer*.exe^|FINDSTR /l ":"^|FINDSTR /l /v "^ & %% !!"') DO IF EXIST "%%I" SET "KILLERPATH=%%~dpI" >nul 2>&1
- IF DEFINED KILLERPATH START "" "%KILLERPATH%\BFNService.exe" -k >nul 2>&1
- IF DEFINED KILLERPATH RMDIR /S /Q "%KILLERPATH%\bflwf" >nul 2>&1
- IF DEFINED KILLERPATH START "" "%KILLERPATH%\BFNService.exe" -u >nul 2>&1
- SC delete BfLwf >nul 2>&1
- ::3. cleanup reg
- FOR /F %%I IN ('REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}" /s /d /f "BfLwf.ndi"^|FINDSTR /I /L /V "Linkage"^|FINDSTR /I /L "\\Class\\"') DO SET "REGPATH=%%I" >nul 2>&1
- IF NOT [%REGPATH%]==[] REG DELETE "%REGPATH%" /f >nul 2>&1
- IF NOT [%REGPATH%]==[] SET REGPATH=%REGPATH:CurrentControlSet=ControlSet001% >nul 2>&1
- IF NOT [%REGPATH%]==[] REG DELETE "%REGPATH%" /f >nul 2>&1
- IF NOT [%REGPATH%]==[] SET REGPATH=%REGPATH:ControlSet001=ControlSet002% >nul 2>&1
- IF NOT [%REGPATH%]==[] REG DELETE "%REGPATH%" /f >nul 2>&1
- FOR %%I IN (ControlSet002 ControlSet001 CurrentControlSet) DO (
- REG DELETE "HKEY_LOCAL_MACHINE\SYSTEM\%%I\services\eventlog\System\BfLwf" /f /va >nul 2>&1
- REG DELETE "HKEY_LOCAL_MACHINE\SYSTEM\%%I\services\BfLwf" /f /va >nul 2>&1
- )
- FOR /F "tokens=1* delims=_" %%I IN ('REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\PnpLockdownFiles /v /f "bflwf*.sys"^|FINDSTR /I /L "bflwf"') DO SET "REGPATH=%%I" >nul 2>&1
- IF NOT [%REGPATH%]==[] SET REGPATH=%REGPATH:~0,-3% &CALL :TRIM REGPATH
- IF NOT [%REGPATH%]==[] REG DELETE HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\PnpLockdownFiles /f /v "%REGPATH%" /reg:32 >nul 2>&1
- IF NOT [%REGPATH%]==[] REG DELETE HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\PnpLockdownFiles /f /v "%REGPATH%" /reg:64 >nul 2>&1
- DEL /F /Q "%SSVAR%\drivers\bflwfx86.sys" >nul 2>&1
- DEL /F /Q "%SSVAR%\drivers\bflwfx64.sys" >nul 2>&1
- DEL /F /Q "%USERPROFILE%\Start Menu\Programs\Startup\Bigfoot*" >nul 2>&1
- DEL /F /Q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup\Bigfoot*" >nul 2>&1
- REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /f /v "Bigfoot Networks Killer Network Manager" >nul 2>&1
- REG DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /f /v "Bigfoot Networks Killer Network Manager" >nul 2>&1
- GOTO :eof
- ::END.GEN_KILLER_BC_DISABLER
- :GEN_AMD_APEX_QUICKSTREAM_DISABLER
- CALL :XECHO AMD/APEX Quickstream disabler
- TASKKILL /im "appexacceleratorui.exe" >nul 2>&1
- TASKKILL /im "AMDQuickStream.exe" >nul 2>&1
- NET stop APXACC >nul 2>&1
- SC stop APXACC >nul 2>&1
- SC delete APXACC >nul 2>&1
- FOR /F %%I IN ('REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}" /s /d /f "APXACC.ndi"^|FINDSTR /I /L /V "Linkage"^|FINDSTR /I /L "\\Class\\"') DO SET "REGPATH=%%I" >nul 2>&1
- IF NOT [%REGPATH%]==[] REG DELETE "%REGPATH%" /f >nul 2>&1
- IF NOT [%REGPATH%]==[] SET REGPATH=%REGPATH:CurrentControlSet=ControlSet001% >nul 2>&1
- IF NOT [%REGPATH%]==[] REG DELETE "%REGPATH%" /f >nul 2>&1
- IF NOT [%REGPATH%]==[] SET REGPATH=%REGPATH:ControlSet001=ControlSet002% >nul 2>&1
- IF NOT [%REGPATH%]==[] REG DELETE "%REGPATH%" /f >nul 2>&1
- FOR %%I IN (ControlSet002 ControlSet001 CurrentControlSet) DO (
- REG DELETE "HKEY_LOCAL_MACHINE\SYSTEM\%%I\services\eventlog\System\APXACC" /f /va >nul 2>&1
- REG DELETE "HKEY_LOCAL_MACHINE\SYSTEM\%%I\services\APXACC" /f /va >nul 2>&1
- )
- FOR /F "tokens=1* delims=_" %%I IN ('REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\PnpLockdownFiles /v /f "appexD*.sys"^|FINDSTR /I /L "appexD"') DO SET "REGPATH=%%I" >nul 2>&1
- IF NOT [%REGPATH%]==[] SET REGPATH=%REGPATH:~0,-3% &CALL :TRIM REGPATH
- IF NOT [%REGPATH%]==[] REG DELETE HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\PnpLockdownFiles /f /v "%REGPATH%" /reg:32 >nul 2>&1
- IF NOT [%REGPATH%]==[] REG DELETE HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\PnpLockdownFiles /f /v "%REGPATH%" /reg:64 >nul 2>&1
- DEL /F /Q "%SSVAR%\drivers\appexDrv.sys" >nul 2>&1
- DEL /F /Q "%USERPROFILE%\Start Menu\Programs\Startup\AppEx*" >nul 2>&1
- DEL /F /Q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup\AppEx*" >nul 2>&1
- REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /f /v "AppEx Accelerator UI" >nul 2>&1
- REG DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /f /v "AppEx Accelerator UI" >nul 2>&1
- GOTO :eof
- ::END.GEN_AMD_APEX_QUICKSTREAM_DISABLER
- :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 #WakeOnMagicPacket #WakeOnPattern Ioac_SwoiSupported Moderate Promiscuous ShutdownWake SleepSpeed) DO SET "opt=%%n" &SET "opt=!opt:#=*!" ® ADD "!REGPATH!" /F /V !opt! /T REG_SZ /D 0 >nul 2>&1
- FOR %%m IN (#DeviceSleepOnDisconnect #LsoV2IPv4 #LsoV2IPv6 #PMARPOffload TaskOffload #RSS RSS) DO SET "opt=%%m" &SET "opt=!opt:#=*!" ® ADD "!REGPATH!" /F /V !opt! /T REG_SZ /D 1 >nul 2>&1
- FOR %%o IN (#IPChecksumOffloadIPv4 #TCPChecksumOffloadIPv4 #TCPChecksumOffloadIPv6 #UDPChecksumOffloadIPv4 #UDPChecksumOffloadIPv6) DO SET "opt=%%o" &SET "opt=!opt:#=*!" ® ADD "!REGPATH!" /F /V !opt! /T REG_SZ /D 3 >nul 2>&1
- REG ADD "!REGPATH!" /F /V "*JumboPacket" /T REG_SZ /D 1514 >nul 2>&1
- REG ADD "!REGPATH!" /F /V "*ReceiveBuffers" /T REG_SZ /D 512 >nul 2>&1
- REG ADD "!REGPATH!" /F /V "*RSSProfile" /T REG_SZ /D 5 >nul 2>&1
- REG ADD "!REGPATH!" /F /V "*SSIdleTimeout" /T REG_SZ /D 60 >nul 2>&1
- REG ADD "!REGPATH!" /F /V "*TransmitBuffers" /T REG_SZ /D 256 >nul 2>&1
- REG ADD "!REGPATH!" /F /V "MaxInterrupt" /T REG_SZ /D 5000 >nul 2>&1
- )
- GOTO :eof
- ::END.GEN_HW_NIC_TWEAKS
- :GEN_OS_SPEEDGUIDE_TWEAKS
- CALL :XECHO OS Speedguide.net tweaks
- IF %WINVERSION% GTR 61 (
- REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Nsi\{eb004a03-9b1a-11d4-9123-0050047759bc}\0" /F /v 0200 /T REG_BINARY /D 0000000000000100000000000000000000000000000000000000000002000000000000000000000000000000000000?000000ff000000000000000000000000000000000000000000?ff000000000000000000000000000000 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Nsi\{eb004a03-9b1a-11d4-9123-0050047759bc}\0" /F /v 1700 /T REG_BINARY /D 0000000000000100000000000000000000000000000000000000000002000000000000000000000000000000000000?000000ff000000000000000000000000000000000000000000?ff000000000000000000000000000000 >nul 2>&1
- )
- NETSH int tcp set heuristics wsh=disabled &NETSH int ip set global taskoffload=enabled
- FOR %%I IN ("autotuninglevel=restricted" "chimney=enabled" "congestionprovider=ctcp" "netdma=disabled" "rss=enabled" "timestamps=enabled") DO NETSH int tcp set global %%~I >nul 2>&1
- FOR %%I IN (tcp udp) DO netsh int ipv4 set dynamicport %%I start=32767 num=32767 >nul 2>&1
- FOR %%I IN (MaxNegativeCacheTtl NegativeCacheTime NegativeSOACacheTime NetFailureCacheTime) DO REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" /F /v %%I /T REG_DWORD /D 0 >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 ADD "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\%%I" /F /v MTU /T REG_DWORD /D 0x5d4 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\%%I" /F /v TcpAckFrequency /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\%%I" /F /v TcpDelAckTicks /T REG_DWORD /D 0 >nul 2>&1
- )
- REG ADD "HKLM\SOFTWARE\Microsoft\MSMQ\Parameters" /F /v TCPNoDelay /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /F /v NetworkThrottlingIndex /T REG_DWORD /D 0xffffffff >nul 2>&1
- REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /F /v SystemResponsiveness /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\Psched" /F /v NonBestEffortLimit /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters" /F /v DisableBandwidthThrottling /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters" /F /v DisableLargeMtu /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v DefaultTTL /T REG_DWORD /D 0x40 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v DisableLargeMtu /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v DisableTaskOffload /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v EnableConnectionRateLimiting /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v EnableTCPA /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v EnableWsd /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /F /v StrictTimeWaitSeqCheck /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /F /v Tcp1323Opts /T REG_DWORD /D 3 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /F /v TcpCreateAndConnectTcbRateLimitDepth /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /F /v TCPMaxDataRetransmissions /T REG_DWORD /D 5 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /F /v TcpTimedWaitDelay /T REG_DWORD /D 0x3c >nul 2>&1
- rem REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\AFD\Parameters" /F /v IgnorePushBitOnReceives /T REG_DWORD /D 1 >nul 2>&1
- rem REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\AFD\Parameters" /F /v NonBlockingSendSpecialBuffering /T REG_DWORD /D 1 >nul 2>&1
- SET /A _tcpservpri_=3 &FOR %%I IN (LocalPriority HostsPriority DnsPriority NetbtPriority Class) DO (SET /A _tcpservpri_+=1 ® ADD "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\ServiceProvider" /F /v %%I /T REG_DWORD /D !_tcpservpri_! >nul 2>&1)
- GOTO :eof
- ::END.GEN_OS_SPEEDGUIDE_TWEAKS
- :GEN_OS_COMPATIBILITY_TWEAKS
- CALL :XECHO OS compatibility tweaks - crash, data collection, timeouts, game priority
- FOR %%I IN (AitAgent ProgramDataUpdater) DO SCHTASKS /Change /TN "\Microsoft\Windows\Application Experience\%%I" /DISABLE >nul 2>&1
- FOR %%I IN (Autochk\Proxy Maintenance\WinSAT WindowsBackup\ConfigNotification DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector) DO SCHTASKS /Change /TN "\Microsoft\Windows\%%I" /DISABLE >nul 2>&1
- FOR %%I IN (Consolidator KernelCeipTask UsbCeip) DO SCHTASKS /Change /TN "\Microsoft\Windows\Customer Experience Improvement Program\%%I" /DISABLE >nul 2>&1
- REG ADD "HKCU\Control Panel\Desktop" /F /v HungAppTimeout /T REG_SZ /D 5000 >nul 2>&1
- REG ADD "HKCU\Control Panel\Desktop" /F /v LowLevelHooksTimeout /T REG_SZ /D 5000 >nul 2>&1
- REG ADD "HKCU\Control Panel\Desktop" /F /v WaitToKillAppTimeout /T REG_SZ /D 20000 >nul 2>&1
- REG ADD "HKCU\Software\Microsoft\InputPersonalization" /F /v RestrictImplicitInkCollection /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKCU\Software\Microsoft\InputPersonalization" /F /v RestrictImplicitTextCollection /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\AppHost" /F /v EnableWebContentEvaluation /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKCU\Software\Policies\Microsoft\Windows\AppCompat" /F /v DisablePCA /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKCU\Software\Policies\Microsoft\Windows\EdgeUI" /F /v DisableMFUTracking /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "Affinity" /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "Background Only" /T REG_SZ /D "False" >nul 2>&1
- REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "GPU Priority" /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "Priority" /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "Scheduling Category" /T REG_SZ /D "High" >nul 2>&1
- REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /F /v "SFIO Priority" /T REG_SZ /D "High" >nul 2>&1
- REG ADD "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /F /v CrashDumpEnabled /T REG_DWORD /D 3 >nul 2>&1
- REG ADD "HKLM\SYSTEM\ControlSet001\Control\CrashControl" /F /v CrashDumpEnabled /T REG_DWORD /D 3 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /F /v DontVerifyRandomDrivers /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\PriorityControl" /F /v IRQ8Priority /T REG_DWORD /D 1 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\I/O System" /F /v CountOperations /T REG_DWORD /D 0 >nul 2>&1
- REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /F /v "DisablePagingExecutive" /T REG_DWORD /D 1 >nul 2>&1
- REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\App Management" /F /v COMClassStore >nul 2>&1
- DEL /F /Q "%SSVAR%\mss32.dll" >nul 2>&1
- DEL /F /Q "%WINDIR%\SysWOW64\mss32.dll" >nul 2>&1
- SC config "AeLookupSvc" start= demand >nul 2>&1
- SC start "AeLookupSvc" >nul 2>&1
- GOTO :eof
- ::END.GEN_OS_COMPATIBILITY_TWEAKS
- :GEN_OS_VISUALFX_TWEAKS
- CALL :XECHO OS visual fx tweaks - less animations
- REG ADD "HKCU\Control Panel\Desktop\WindowMetrics" /F /v VisualFXSetting /T REG_DWORD /D 3 >nul 2>&1
- REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /F /v VisualFXSetting /T REG_DWORD /D 3 >nul 2>&1
- REG ADD "HKCU\Control Panel\Desktop" /F /v UserPreferencesMask /T REG_BINARY /D 9812038010000000 >nul 2>&1
- FOR %%I IN (CompositionPolicy ListBoxSmoothScrolling TooltipAnimation TaskbarAnimations SelectionFade MenuAnimation ListviewWatermark ListviewShadow ListviewAlphaSelect DropShadow CursorShadow ControlAnimations ComboBoxAnimation AnimateMinMax) DO REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\%%I" /F /v DefaultApplied /T REG_DWORD /D 0 >nul 2>&1
- 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 ADD "HKCU\Control Panel\Desktop\WindowMetrics" /F /v MinAnimate /T REG_SZ /D 0 >nul 2>&1
- REG ADD "HKCU\Software\Microsoft\Windows\DWM" /F /v Max3DWindows /T REG_DWORD /D 4 >nul 2>&1
- GOTO :eof
- ::END.GEN_OS_VISUALFX_TWEAKS
- ::::::::::::::::::
- :: DOTA SECTION ::
- ::::::::::::::::::
- :DOTA_DETECT_PATHS
- CALL :XECHO Detect Steam and Dota paths
- SET "STEAMPATH="
- FOR /F delims^=^"^ tokens^=2* %%I IN ('REG QUERY "HKCR\steam\Shell\Open\Command" /ve^|FINDSTR /I /L ":"') DO SET "STEAMREG=%%~I"
- FOR /F "tokens=*" %%I IN ("%STEAMREG%") DO SET "CHECKPATH=%%~dpI"
- IF EXIST "%CHECKPATH%Steam.exe" SET "STEAMPATH=%CHECKPATH:~0,-1%"
- :: Valve why do you use linux paths under windows?!
- IF NOT DEFINED STEAMPATH FOR /F "tokens=2* delims=_" %%I IN ('REG QUERY "HKCU\SOFTWARE\Valve\Steam"^|FINDSTR /I /L "SteamPath"') DO SET "STEAMREG=%%~I"
- IF NOT DEFINED STEAMPATH SET "STEAMREG=%STEAMREG:~6%"
- IF NOT DEFINED STEAMPATH SET "CHECKPATH=%STEAMREG:/=\%"
- IF NOT DEFINED STEAMPATH IF EXIST "%CHECKPATH%\Steam.exe" SET "STEAMPATH=%CHECKPATH%"
- IF NOT EXIST "%STEAMPATH%\Steam.exe" CALL :XECHO Steam not found, reinstall / clean all except Steam.exe and SteamApps
- IF EXIST "%STEAMPATH%\Steam.exe" CALL :XECHO Steam found in %STEAMPATH%
- :: detect dota path
- SET "DOTAPATH="
- FOR /F delims^=^"^ tokens^=2* %%I IN ('REG QUERY "HKCR\Applications\dota.exe\shell\open\command" /ve^|FINDSTR /I /L ":"') DO SET "DOTAREG=%%~I"
- FOR /F "tokens=*" %%I IN ("%DOTAREG%") DO SET "CHECKPATH=%%~dpI"
- IF EXIST "%CHECKPATH%dota\maps\dota.bsp" SET "DOTAPATH=%CHECKPATH:~0,-1%"
- IF NOT DEFINED DOTAPATH FOR /F delims^=^"^ tokens^=2* %%I IN ('REG QUERY "HKCR\dota2\Shell\Open\Command" /ve^|FINDSTR /I /L ":"') DO SET "DOTAREG=%%~I"
- IF NOT DEFINED DOTAPATH FOR /F "tokens=*" %%I IN ("%DOTAREG%") DO SET "CHECKPATH=%%~dpI"
- IF NOT DEFINED DOTAPATH IF EXIST "%CHECKPATH%dota\maps\dota.bsp" SET "DOTAPATH=%CHECKPATH:~0,-1%"
- :: fallback to default steam path
- IF NOT DEFINED DOTAPATH SET "DOTAPATH=%STEAMPATH%\SteamApps\common\dota 2 beta"
- IF NOT EXIST "%DOTAPATH%\dota\maps\dota.bsp" SET "DOTAPATH="
- :: damn valve why don't you have a reg entry for library folders?
- IF NOT DEFINED DOTAPATH IF EXIST "%STEAMPATH%\SteamApps\libraryfolders.vdf" (
- FOR /F "tokens=2" %%I IN ('FINDSTR /V "LibraryFolders { }" "%STEAMPATH%\SteamApps\libraryfolders.vdf"') DO (
- SET "CHECKPATH=%%~I"
- SET "CHECKPATH=!CHECKPATH:\\=\!"
- IF EXIST "!CHECKPATH!\SteamApps\common\dota 2 beta\dota\maps\dota.bsp" SET "DOTAPATH=!CHECKPATH!\SteamApps\common\dota 2 beta"
- ))
- IF NOT EXIST "%DOTAPATH%\dota\maps\dota.bsp" CALL :XERR Dota not found, reinstall or add local dota folder to steam library
- CALL :XECHO Dota found in %DOTAPATH%
- :: cleanup
- DEL /F /Q "%USERPROFILE%\Desktop\Dota 2 *.lnk" >nul 2>&1
- RMDIR /S /Q "%USERPROFILE%\Desktop\Dota 2 Test shortcuts" >nul 2>&1
- RMDIR /S /Q "%STEAMPATH%\appcache" >nul 2>&1
- GOTO :eof
- ::END.DOTA_DETECT_PATHS
- :DOTA_CREATE_TEST_SHORTCUT
- :: Usage: CALL :DOTA_CREATE_TEST_SHORTCUT shortcutname displaymode(windowed/windowedfs/noborder/fullscreen) d3d(d3d9ex/nod3d9ex) hwsync(0/1) matqueue(-1/0/1/2) threaded(0/1) vsync(0/1)
- :: Valve bug: windowed mode is either with border or without border, cannot switch them using launch options, it only works from gui menu - workaround scripts added
- IF [%2]==[windowed] (SET "DISPLAYMODE=-windowed") ELSE IF [%2]==[windowedfs] (SET "DISPLAYMODE=-windowed -x -3 -y -25") ELSE IF [%2]==[noborder] (SET "DISPLAYMODE=-noborder") ELSE IF [%2]==[fullscreen] SET "DISPLAYMODE=-fullscreen"
- IF [%3]==[d3d9ex] (SET "D3D9EX=") ELSE IF [%3]==[nod3d9ex] SET "D3D9EX= -nod3d9ex"
- SET "HWSYNC=%4"
- SET "MATQUEUE=%5"
- SET "THREADED=%6"
- SET "VSYNC=%7"
- echo Dota 2 %1 %2_%3.lnk
- :: CHOOSE NEW DOTA DESKTOP SHORTCUT's OPTIONS BELOW:
- SET MOUSE=-useforcedmparms -noforcemaccel -noforcemspd
- SET SYNC= +mat_forcehardwaresync %HWSYNC% +mat_vsync %VSYNC% +mat_triplebuffered %VSYNC%
- SET CPU=+mat_queue_mode %MATQUEUE% +cl_threaded_init %THREADED% +cl_threaded_bone_setup %THREADED% +r_queued_decals %THREADED% +r_queued_post_processing %THREADED% +r_threaded_shadow_clip %THREADED%
- SET SOUND=+snd_mix_async 1 +snd_pitchquality 0 +dsp_slow_cpu 1
- :: create a new dota2 shortcut with troubleshooting launch options
- SET "DOTA_LAUNCH_OPTIONS=-applaunch 570 -high -dev -noaafonts %DISPLAYMODE%%D3D9EX% %MOUSE% %SYNC% %CPU% %SOUND% +cl_singleplayernetworkbackdoor 1 +con_enable 1 +dota_embers 0 +developer 0 +exec autoexec.cfg
- IF NOT EXIST "%USERPROFILE%\Desktop\Dota 2 Test shortcuts" MD "%USERPROFILE%\Desktop\Dota 2 Test shortcuts" >nul 2>&1
- echo Set ws = WScript.CreateObject("WScript.Shell") >"%temp%\~1337lnk.vbs"
- echo dota = "%USERPROFILE%\Desktop\Dota 2 Test shortcuts\Dota 2 %1 %2_%3.lnk" >>"%temp%\~1337lnk.vbs"
- echo Set lnk = ws.CreateShortcut(dota) >>"%temp%\~1337lnk.vbs"
- echo lnk.TargetPath = chr(34) ^& "%STEAMPATH%\Steam.exe" ^& chr(34)>>"%temp%\~1337lnk.vbs"
- echo lnk.Arguments = "%DOTA_LAUNCH_OPTIONS%" >>"%temp%\~1337lnk.vbs"
- echo lnk.IconLocation = "%DOTAPATH%\dota.exe,0" >>"%temp%\~1337lnk.vbs"
- echo lnk.Description = "Dota 2 %1 launch options: %2,%3,hwsync%4,matqueue%5,threaded%6,vsync%7 - GameFixer by aveyo" >>"%temp%\~1337lnk.vbs"
- echo lnk.Save >>"%temp%\~1337lnk.vbs"
- CALL CSCRIPT //nologo "%temp%\~1337lnk.vbs" &DEL /F /Q "%temp%\~1337lnk.vbs"
- GOTO :eof
- ::END.DOTA_CREATE_TEST_SHORTCUT
- :DOTA_CREATE_TEST_WINDOWED_NOBORDER_TOGGLE
- CALL :XECHO Create windowed noborder toggle scripts [Valve launch options bug]
- :: generate windowed with borders enabler script (because of Valve bug)
- echo @echo off ^&SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable windowed tests.bat"
- echo IF NOT EXIST "%DOTAPATH%\dota\cfg\video.txt" GOTO :eof >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable windowed tests.bat"
- echo CD /D "%DOTAPATH%\dota\cfg\" >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable windowed tests.bat"
- echo FOR /f "tokens=1 delims=: eol=?" %%%%I IN ('FINDSTR /N /L nowindowborder "video.txt"') DO SET /A "nowindowborder=%%%%I" >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable windowed tests.bat"
- echo FOR /F "TOKENS=1,2* DELIMS=[]" %%%%H IN ('TYPE "video.txt" ^^^| FIND /V /N ""') DO ( >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable windowed tests.bat"
- echo SET "FOUNDLINE=0" >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable windowed tests.bat"
- echo IF [%%%%H]==[%%nowindowborder%%] ECHO/ "setting.nowindowborder" "0"^>^> video.txt.tmp ^&SET "FOUNDLINE=1" >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable windowed tests.bat"
- echo IF ^^!FOUNDLINE^^! EQU 0 ECHO/%%%%I^>^> video.txt.tmp >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable windowed tests.bat"
- echo ) >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable windowed tests.bat"
- echo DEL /F /Q video.txt ^>nul 2^>^&1 >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable windowed tests.bat"
- echo RENAME video.txt.tmp video.txt ^>nul 2^>^&1 >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable windowed tests.bat"
- :: generate noborder enabler script - default (because of Valve bug)
- echo @echo off ^&SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable noborder tests - default.bat"
- echo IF NOT EXIST "%DOTAPATH%\dota\cfg\video.txt" GOTO :eof >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable noborder tests - default.bat"
- echo CD /D "%DOTAPATH%\dota\cfg\" >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable noborder tests - default.bat"
- echo FOR /f "tokens=1 delims=: eol=?" %%%%I IN ('FINDSTR /N /L nowindowborder "video.txt"') DO SET /A "nowindowborder=%%%%I" >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable noborder tests - default.bat"
- echo FOR /F "TOKENS=1,2* DELIMS=[]" %%%%H IN ('TYPE "video.txt" ^^^| FIND /V /N ""') DO ( >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable noborder tests - default.bat"
- echo SET "FOUNDLINE=0" >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable noborder tests - default.bat"
- echo IF [%%%%H]==[%%nowindowborder%%] ECHO/ "setting.nowindowborder" "1"^>^> video.txt.tmp ^&SET "FOUNDLINE=1" >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable noborder tests - default.bat"
- echo IF ^^!FOUNDLINE^^! EQU 0 ECHO/%%%%I^>^> video.txt.tmp >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable noborder tests - default.bat"
- echo ) >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable noborder tests - default.bat"
- echo DEL /F /Q video.txt ^>nul 2^>^&1 >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable noborder tests - default.bat"
- echo RENAME video.txt.tmp video.txt ^>nul 2^>^&1 >>"%USERPROFILE%\Desktop\Dota 2 Test shortcuts\enable noborder tests - default.bat"
- GOTO :eof
- ::END.DOTA_CREATE_TEST_WINDOWED_NOBORDER_TOGGLE
- :DOTA_CREATE_AUTOEXEC
- CALL :XECHO Create fresh autoexec.cfg with some default fixes
- IF NOT EXIST "%DOTAPATH%\dota\cfg\*" MD "%DOTAPATH%\dota\cfg" >nul 2>&1
- CD /D "%DOTAPATH%\dota\cfg"
- :: Did you previously run dota_troubleshooter? (too many versions, hard to detect and force an update)
- FINDSTR /I /L "GENERATED_BY_GAMEFIXER_DO_NOT_REMOVE" personal.cfg >nul 2>&1
- IF %ERRORLEVEL% EQU 0 DEL /F /Q "personal.cfg"
- FINDSTR /I /L "GENERATED_BY_GAMEFIXER_DO_NOT_REMOVE" autoexec.cfg >nul 2>&1
- IF %ERRORLEVEL% EQU 1 IF EXIST "personal.cfg" COPY /Y "autoexec.cfg" "personal%RANDOM%%RANDOM%%RANDOM%.cfg" &DEL /F /Q "autoexec.cfg" &GOTO :_WRITE_AUTOEXEC
- IF %ERRORLEVEL% EQU 1 IF NOT EXIST "personal.cfg" COPY /Y "autoexec.cfg" "personal.cfg" &DEL /F /Q "autoexec.cfg" &GOTO :_WRITE_AUTOEXEC
- IF %ERRORLEVEL% EQU 0 GOTO :_WRITE_AUTOEXEC
- GOTO :eof
- :_WRITE_AUTOEXEC
- echo //// GENERATED_BY_GAMEFIXER_DO_NOT_REMOVE_OR_EDIT_THIS_SIGNATURE_LINE_TO_PREVENT_OVERWRITES >"autoexec.cfg"
- echo echo autoexec.cfg loaded // v%_MYVER% by aveyo>>"autoexec.cfg"
- echo //// If you had an autoexec.cfg before, it's now renamed to personal.cfg and autoloaded by this script >>"autoexec.cfg"
- echo //// Don't edit this file, instead use personal.cfg to set your aliases, binds, dota_ commands >>"autoexec.cfg"
- echo execifexists personal.cfg //autoload personal file first, filtering out overrides >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo con_enable "1" //Enable console >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //cl_showfps "1" //set to 2 to see average fps over many frames >>"autoexec.cfg"
- echo //fps_max "0" //if vsync=on, set it to display Hz-2 to lower inputlag, else to display Hz >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo dota_embers "0" //Fix stuttering/crashes in game menu by turning off flash animated background >>"autoexec.cfg"
- echo engine_no_focus_sleep "20" //Limit fps when alt-tab, 0=disable and waste power, 20=default, I'm using 100 with no issues >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //// Fix some unnecesarry GPU usage spike and overheating by turning off visual effects on pause/death/shake >>"autoexec.cfg"
- echo dota_camera_deatheffect "0" >>"autoexec.cfg"
- echo dota_screen_shake "0" >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //// Fix crashing after second local lobby creation: http://dev.dota2.com/showthread.php?t=147736 >>"autoexec.cfg"
- echo cl_singleplayernetworkbackdoor "1" >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //// Manually fix can't connect to any servers if on LAN or if your router/firewall wants a dedicated clientport >>"autoexec.cfg"
- echo //// "the default clientport is 27005 and you can only have one game with that port active on the same lan" >>"autoexec.cfg"
- echo //// https://support.steampowered.com/kb_article.php?ref=6370-QPHJ-3567 >>"autoexec.cfg"
- echo clientport "-1" //Autodetect is -1 Accepts value in ranges 27005-27019 or 27021-27032 >>"autoexec.cfg"
- echo clientportany "1" //If you change clientport from -1, you need to also change clientportany to 0 >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //// Fix sound stuttering in main menu, improves performance for onboard sound >>"autoexec.cfg"
- echo dsp_enhance_stereo "0" >>"autoexec.cfg"
- echo dsp_slow_cpu "1" >>"autoexec.cfg"
- echo snd_mix_async "1" >>"autoexec.cfg"
- echo snd_pitchquality "0" >>"autoexec.cfg"
- echo //snd_mute_losefocus "0" // Play sound in desktop 0=yes >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //// Preload models to increase fps, mostly for AD/ARDM >>"autoexec.cfg"
- echo cl_forcepreload "1" >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //// Fix/minimize network issues in online game >>"autoexec.cfg"
- echo //// you can get artificial 33ms lerp by cl_interp_ratio 1 and up and cmd rates to 60 >>"autoexec.cfg"
- echo cl_allowdownload "0" >>"autoexec.cfg"
- echo cl_allowupload "0" >>"autoexec.cfg"
- echo cl_cmdrate "30" //server clamped to 30 >>"autoexec.cfg"
- echo cl_interp "0" //limited by server tickrate to 0.033333 >>"autoexec.cfg"
- echo cl_interp_ratio "2" //set to 3 if constant packet loss>>"autoexec.cfg"
- echo cl_lagcompensation "1" >>"autoexec.cfg"
- echo cl_lagcomp_errorcheck "1" >>"autoexec.cfg"
- echo cl_pred_optimize "2" >>"autoexec.cfg"
- echo cl_predictweapons "1" >>"autoexec.cfg"
- echo cl_resend "15" >>"autoexec.cfg"
- echo cl_smooth "1" >>"autoexec.cfg"
- echo cl_smoothtime "0.066666" //try also "0.033333" or def "0.1" >>"autoexec.cfg"
- echo cl_timeout "15" >>"autoexec.cfg"
- echo cl_updaterate "30" //server clamped to 30 >>"autoexec.cfg"
- echo net_compressvoice "1" >>"autoexec.cfg"
- echo net_maxcleartime "1.0" //try also 0.066666 or def "4.0" >>"autoexec.cfg"
- echo net_max_network_processing_frame_time_ms "20" //try also 16 or 33 or def "20" >>"autoexec.cfg"
- echo net_splitrate "2" >>"autoexec.cfg"
- echo rate "120000" >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //// Net_graph preset >>"autoexec.cfg"
- echo alias "setnetgraph" "net_graphproportionalfont 0; net_graphpos 3; net_graphsolid 0; net_graphinsetbottom 0; net_graphinsettop 0; net_graphinsetleft 0; net_graphinsetright 0; net_scale 2000; net_graphmsecs 200; net_graphheight 100; net_graphinsetbottom 360" >>"autoexec.cfg"
- echo alias "netgraph_off" "net_graph 0;alias netgraph netgraph_on" >>"autoexec.cfg"
- echo alias "netgraph_on" "setnetgraph;net_graph 4;alias netgraph netgraph_off" >>"autoexec.cfg"
- echo alias "netgraph" "netgraph_off" >>"autoexec.cfg"
- echo //bind "DEL" "netgraph" //or just write netgraph in console to show/hide >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //// Misc >>"autoexec.cfg"
- echo bugreporter_includebsp "0" //cleaner crash dumps >>"autoexec.cfg"
- echo dota_html_panel "0" >>"autoexec.cfg"
- echo dota_quit_immediate "1" >>"autoexec.cfg"
- echo developer "0" >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //// Force advanced video settings by uncommenting the lines below (GUI settings not saved after quit) >>"autoexec.cfg"
- echo //// CONSOLE VARIABLE DESCRIPTION TRY INTERVAL >>"autoexec.cfg"
- echo mat_monitorgamma_tv_enabled "0" // PC or TV levels PC 0=PC 1=TV >>"autoexec.cfg"
- echo //mat_monitorgamma "1.8" // Brightness 1.8 1.8=130 >>"autoexec.cfg"
- echo //r_screenspace_aa "0" // Anti-aliasing OF 0=Off 1=On >>"autoexec.cfg"
- echo //r_deferred_specular "0" // Specular OF 0=Off 1=On >>"autoexec.cfg"
- echo //r_deferred_specular_bloom "0" // Specular bloom OF 0=Off 1=On >>"autoexec.cfg"
- echo //dota_cheap_water "1" // High Quality Water OF 0=On 1=Off >>"autoexec.cfg"
- echo //r_deferred_height_fog "0" // Athmospheric Fog OF 0=Off 1=On >>"autoexec.cfg"
- echo //dota_portrait_animate "1" // Animate portrait ON 0=Off 1=On >>"autoexec.cfg"
- echo //r_deferred_additive_pass "0" // Additive light pass OF 0=Off 1=On >>"autoexec.cfg"
- echo //r_deferred_simple_light "1" // World lighting ON 0=Off 1=On >>"autoexec.cfg"
- echo //r_ssao "0" // Ambient occlusion OF 0=Off 1=On >>"autoexec.cfg"
- echo //dota_ambient_creatures "0" // Ambient creatures OF 0=Off 1=On >>"autoexec.cfg"
- echo //mat_vsync "0" // Vertical Sync OF 0=Off 1=On >>"autoexec.cfg"
- echo //mat_viewportscale "0.9" // Render Quality 90 0.4=40 1=100 >>"autoexec.cfg"
- echo //cl_globallight_shadow_mode "2" // Shadows HI 0=Low 1=Med 2=High >>"autoexec.cfg"
- echo //mat_picmip "0" // Textures HI 2=Low 1 Med 0=High >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //// Engine extra tweaks >>"autoexec.cfg"
- echo ai_expression_optimization "1" >>"autoexec.cfg"
- echo cl_detaildist "900" >>"autoexec.cfg"
- echo cl_detailfade "300" >>"autoexec.cfg"
- echo //cl_ejectbrass "0" >>"autoexec.cfg"
- echo cl_particle_fallback_base "4" >>"autoexec.cfg"
- echo cl_particle_fallback_multiplier "0" >>"autoexec.cfg"
- echo dota_ambient_creatures_pop "1" >>"autoexec.cfg"
- echo //mat_bloomscale "0" >>"autoexec.cfg"
- echo //mat_bumpmap "0" >>"autoexec.cfg"
- echo //mat_disable_bloom "1" >>"autoexec.cfg"
- echo //mat_filterlightmaps "0" >>"autoexec.cfg"
- echo //mat_forcehardwaresync "0" //Intel and Nvidia cards issues >>"autoexec.cfg"
- echo //mat_phong "0" >>"autoexec.cfg"
- echo mat_reducefillrate "1" >>"autoexec.cfg"
- echo mat_reduceparticles "1" >>"autoexec.cfg"
- echo //mat_specular "0" >>"autoexec.cfg"
- echo ragdoll_sleepaftertime "3" >>"autoexec.cfg"
- echo r_3dsky "0" >>"autoexec.cfg"
- echo r_forcewaterleaf "1" >>"autoexec.cfg"
- echo r_occlusion "1" >>"autoexec.cfg"
- echo r_propsmaxdist "900" >>"autoexec.cfg"
- echo //r_renderoverlayfragment "0" >>"autoexec.cfg"
- echo r_shadow_half_update_rate "1" >>"autoexec.cfg"
- echo //r_waterdrawreflection "0" >>"autoexec.cfg"
- echo //r_Waterdrawrefraction "0" >>"autoexec.cfg"
- echo r_waterforceexpensive "0" >>"autoexec.cfg"
- echo r_waterforcereflectentities "0" >>"autoexec.cfg"
- echo. >>"autoexec.cfg"
- echo //// Dota_ commands >>"autoexec.cfg"
- echo dota_ability_quick_cast "1" // Doubletapping to selfcast def=0 >>"autoexec.cfg"
- echo //dota_always_show_player_names "0" // Always show player names def=1 >>"autoexec.cfg"
- echo dota_camera_accelerate "50" // Decelerating map scroll >>"autoexec.cfg"
- echo //dota_camera_disable_zoom "0" // Disables mousewheel zoom def=0 >>"autoexec.cfg"
- echo //dota_camera_edgemove "1" // Moves camera when cursor hits edge of screen >>"autoexec.cfg"
- echo //dota_camera_hold_select_to_follow "0" // Hold key to follow hero - breaks rune scripts so disable it >>"autoexec.cfg"
- echo //dota_camera_reverse "0" // Inverted movements when gripping camera >>"autoexec.cfg"
- echo dota_camera_speed "6000" // Scrolling speed dota1-like feels best >>"autoexec.cfg"
- echo //dota_disable_range_finder "0" // Range finder on >>"autoexec.cfg"
- echo dota_force_right_click_attack "1" // Rightclick deny enabled def=0 >>"autoexec.cfg"
- echo //dota_hud_healthbar_number "1" // Health number above the lifebar on >>"autoexec.cfg"
- echo dota_minimap_always_draw_hero_icons "1" // Always show hero portrer/text on minimap. def=0 >>"autoexec.cfg"
- echo dota_minimap_hero_size "800" // Slightly bigger hero icons on minimap def=600 >>"autoexec.cfg"
- echo dota_minimap_misclick_time "0" // Every click on the minimap counts >>"autoexec.cfg"
- echo //dota_player_add_summoned_to_selection "1" // Automatically adds summoned creeps in controlled group. def=0 >>"autoexec.cfg"
- echo //dota_player_multipler_orders "1" // Control all units with CTRL click def=0 >>"autoexec.cfg"
- echo dota_player_teleport_requires_halt "1" // Prevent teleport canceled because of movement def=0 >>"autoexec.cfg"
- echo //dota_player_units_auto_attack "0" // Hero autoattack disabled def=1 >>"autoexec.cfg"
- echo dota_reset_camera_on_spawn "0" // Don't reset camera on respawn def=1 >>"autoexec.cfg"
- echo dota_unit_fly_bonus_height "150" // Flying height of air units >>"autoexec.cfg"
- echo dota_unit_use_player_color "1" // Colorize units by player color >>"autoexec.cfg"
- GOTO :eof
- ::END.DOTA_CREATE_AUTOEXEC
- :DOTA_FIX_PERMISSIONS
- CALL :XECHO Removing compatibility options for steam and dota executables
- :: magic starts here
- FOR %%I IN ("%STEAMPATH%\Steam.exe" "%STEAMPATH%\bin\steamservice.exe" "%DOTAPATH%\dota.exe") DO (FOR %%J IN (32 64) DO (
- REG DELETE "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Persisted" /v %%I /f /reg:%%J >nul 2>&1
- REG DELETE "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v %%I /f /reg:%%J >nul 2>&1
- REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v %%I /f /reg:%%J >nul 2>&1
- ))
- GOTO :eof
- ::END.DOTA_FIX_PERMISSIONS
- :DOTA_STEAM_SERVICE
- CALL :XECHO Cleaning Steam Service
- :: process explorer running results in steamservice install failure
- TASKKILL /F /IM procexp.exe /T >nul 2>&1
- TASKKILL /F /IM procexp64.exe /T >nul 2>&1
- SC DELETE "Steam Client Service" >nul 2>&1
- DEL /F /Q "%COMMONPROGRAMFILES%\Steam\SteamService.exe" >nul 2>&1
- DEL /F /Q "%COMMONPROGRAMFILES(X86)%\Steam\SteamService.exe" >nul 2>&1
- :: below command does not work anymore because of the heartbleed vulnerability so Steam must do the actual repair
- CALL "%STEAMPATH%\bin\steamservice.exe" /repair
- TITLE %_LABEL%
- CALL :XWAIT 5
- CALL :XECHO On the next Steam run, click [INSTALL SERVICE] if it prompts you.
- GOTO :eof
- ::END.DOTA_STEAM_SERVICE
- :DOTA_OPTIMIZE_STEAM
- CALL :XECHO Optimize Steam settings
- :: scan default configuration
- TASKKILL /F /IM Steam.exe /T >nul 2>&1
- CALL :XWAIT 5
- CD /D "%STEAMPATH%\config"
- FOR /F "tokens=1* delims=/ eol=?" %%I IN ('DIR /-b/-s config.vdf^|FINDSTR /l ":"^|FINDSTR /l /v "^ & %% !!"') DO SET "SDDIR=%%~dpI"
- IF EXIST "%SDDIR%\config.vdf" (CD /D "%SDDIR%") ELSE GOTO :eof
- IF EXIST config.tmp DEL /F /Q config.tmp >nul 2>&1
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L AllowDownloadsDuringGameplay "config.vdf"') DO SET /A "AllowDownloadsDuringGameplay=%%I"
- :: edit default configuration
- FOR /F "TOKENS=1,2* DELIMS=[]" %%H IN ('TYPE "config.vdf" ^| FIND /V /N ""') DO (
- SET "FOUNDLINE=0"
- IF [%%H]==[%AllowDownloadsDuringGameplay%] ECHO/ "AllowDownloadsDuringGameplay" "0">> config.tmp &SET "FOUNDLINE=1"
- IF !FOUNDLINE! EQU 0 ECHO/%%I>> config.tmp
- )
- CALL :VBDOS2UNIX "%SDDIR%\config.tmp" "%SDDIR%\config.vdf"
- DEL /F /Q "%SDDIR%\config.tmp"
- :: scan shared configuration
- CD /D "%STEAMPATH%\userdata"
- FOR /F "tokens=1* delims=/ eol=?" %%I IN ('DIR /-b/-s sharedconfig.vdf^|FINDSTR /l ":"^|FINDSTR /l /v "^ & %% !!"') DO SET "SCDIR=%%~dpI"
- IF EXIST "%SCDIR%\sharedconfig.vdf" (CD /D "%SCDIR%") ELSE GOTO :eof
- IF EXIST sharedconfig.tmp DEL /F /Q sharedconfig.tmp >nul 2>&1
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L SteamDefaultDialog "sharedconfig.vdf"') DO SET /A "SteamDefaultDialog=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L cloudenabled "sharedconfig.vdf"') DO SET /A "cloudenabled=%%I"
- :: edit shared configuration
- FOR /F "TOKENS=1,2* DELIMS=[]" %%H IN ('TYPE "sharedconfig.vdf" ^| FIND /V /N ""') DO (
- SET "FOUNDLINE=0"
- IF [%%H]==[%SteamDefaultDialog%] ECHO/ "SteamDefaultDialog" "#app_friends">> sharedconfig.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%cloudenabled%] ECHO/ "cloudenabled" "0">> sharedconfig.tmp &SET "FOUNDLINE=1"
- IF !FOUNDLINE! EQU 0 ECHO/%%I>> sharedconfig.tmp
- )
- CALL :VBDOS2UNIX "%SCDIR%\sharedconfig.tmp" "%SCDIR%\sharedconfig.vdf"
- DEL /F /Q "%SCDIR%\sharedconfig.tmp"
- :: scan local configuration
- CD /D "%STEAMPATH%\userdata"
- FOR /F "tokens=1* delims=/ eol=?" %%I IN ('DIR /-b/-s localconfig.vdf^|FINDSTR /l ":"^|FINDSTR /l /v "^ & %% !!"') DO SET "LCDIR=%%~dpI"
- IF EXIST "%LCDIR%\localconfig.vdf" (CD /D "%LCDIR%") ELSE GOTO :eof
- IF EXIST localconfig.tmp DEL /F /Q localconfig.tmp >nul 2>&1
- FOR /F "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N } "localconfig.vdf"') DO SET /A "localconfig_eof=%%I"
- IF NOT DEFINED localconfig_eof GOTO :eof
- FOR /F "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N \^"friends\^" "localconfig.vdf" ^| FINDSTR /V \^"friends\^".') DO SET /A "section_friends=%%I+1"
- FOR /F "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N \^"News\^" "localconfig.vdf" ^| FINDSTR /V \^"News\^".') DO SET /A "section_news=%%I+1"
- FOR /F "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N \^"system\^" "localconfig.vdf" ^| FINDSTR /V \^"system\^".') DO SET /A "section_system=%%I+1"
- FOR /F "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N \^"570\^" "localconfig.vdf" ^| FINDSTR /V \^"570\^".') DO SET /A "app570start=%%I" &SET /A "app570end=%%I+8"
- IF DEFINED app570start FOR /F "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L LaunchOptions "localconfig.vdf"') DO IF %%I GTR %app570start% IF %%I LSS %app570end% SET /A "LaunchOptions=%%I"
- FOR %%I IN (PersonaStateDesired Notifications_ShowIngame Sounds_PlayIngame Notifications_ShowOnline Sounds_PlayOnline Notifications_ShowMessage Sounds_PlayMessage AutoSignIntoFriends ShowTimeInChatLogCheck AlwaysNewChatWindow ChatFlashMode EnableStreaming NotifyAvailableGames StartupState.Friends HideSharingNotifications EnableGameOverlay InGameOverlayShortcutKey InGameOverlayScreenshotNotification InGameOverlayScreenshotPlaySound InGameOverlayScreenshotSaveUncompressed InGameOverlayScreenshotHotKey NavUrlBar UsePushToTalk PushToTalkKey JumplistSettings JumplistSettingsKnown) DO FOR /f "tokens=1 delims=: eol=?" %%a IN ('FINDSTR /N /L %%I "localconfig.vdf"') DO SET /A "%%I=%%a"
- :: edit local configuration
- FOR /F "TOKENS=1,2* DELIMS=[]" %%H IN ('TYPE "localconfig.vdf" ^| FIND /V /N ""') DO (
- SET "FOUNDLINE=0"
- FOR %%a in (%Notifications_ShowIngame% %Sounds_PlayIngame% %Notifications_ShowOnline% %Sounds_PlayOnline% %Notifications_ShowMessage% %Sounds_PlayMessage% %AutoSignIntoFriends% %ShowTimeInChatLogCheck% %AlwaysNewChatWindow% %ChatFlashMode% %NotifyAvailableGames% %HideSharingNotifications% %EnableGameOverlay% %InGameOverlayShortcutKey% %InGameOverlayScreenshotNotification% %InGameOverlayScreenshotPlaySound% %InGameOverlayScreenshotSaveUncompressed% %InGameOverlayScreenshotHotKey% %NavUrlBar% %UsePushToTalk% %PushToTalkKey% %JumplistSettings% %JumplistSettingsKnown%) DO IF %%H GTR 2 IF [%%H]==[%%a] SET "FOUNDLINE=1"
- IF %%H GTR 2 IF [%%H]==[%LaunchOptions%] SET "FOUNDLINE=1"
- IF %%H GTR 2 IF [%%H]==[%EnableStreaming%] ECHO/ "EnableStreaming" "0">> localconfig.tmp &SET "FOUNDLINE=1"
- IF %%H GTR 2 IF [%%H]==[%StartupState.Friends%] (
- ECHO/ "StartupState.Friends" "1">> localconfig.tmp
- ECHO/ "HideSharingNotifications" "1">> localconfig.tmp
- SET "FOUNDLINE=1"
- )
- IF %%H GTR 2 IF [%%H]==[%section_friends%] (
- ECHO/ {>> localconfig.tmp
- ECHO/ "AlwaysNewChatWindow" "1">> localconfig.tmp
- ECHO/ "AutoSignIntoFriends" "0">> localconfig.tmp
- ECHO/ "ChatFlashMode" "1">> localconfig.tmp
- ECHO/ "Notifications_ShowIngame" "0">> localconfig.tmp
- ECHO/ "Notifications_ShowMessage" "1">> localconfig.tmp
- ECHO/ "Notifications_ShowOnline" "0">> localconfig.tmp
- ECHO/ "ShowTimeInChatLogCheck" "1">> localconfig.tmp
- ECHO/ "Sounds_PlayIngame" "0">> localconfig.tmp
- ECHO/ "Sounds_PlayMessage" "1">> localconfig.tmp
- ECHO/ "Sounds_PlayOnline" "0">> localconfig.tmp
- SET "FOUNDLINE=1"
- )
- IF %%H GTR 2 IF [%%H]==[%section_news%] (
- ECHO/ {>> localconfig.tmp
- ECHO/ "NotifyAvailableGames" "0">> localconfig.tmp
- SET "FOUNDLINE=1"
- )
- IF %%H GTR 2 IF [%%H]==[%section_system%] (
- ECHO/ {>> localconfig.tmp
- ECHO/ "EnableGameOverlay" "0">> localconfig.tmp
- ECHO/ "InGameOverlayScreenshotNotification" "0">> localconfig.tmp
- ECHO/ "InGameOverlayScreenshotPlaySound" "1">> localconfig.tmp
- ECHO/ "InGameOverlayScreenshotSaveUncompressed" "0">> localconfig.tmp
- ECHO/ "JumplistSettings" "7744">> localconfig.tmp
- ECHO/ "JumplistSettingsKnown" "65535">> localconfig.tmp
- ECHO/ "NavUrlBar" "1">> localconfig.tmp
- ECHO/ "PushToTalkKey" "145">> localconfig.tmp
- ECHO/ "UsePushToTalk" "1">> localconfig.tmp
- SET "FOUNDLINE=1"
- )
- IF %%H EQU %localconfig_eof% IF NOT DEFINED section_system (
- ECHO/ "system">> localconfig.tmp
- ECHO/ {>> localconfig.tmp
- ECHO/ "EnableGameOverlay" "0">> localconfig.tmp
- ECHO/ "InGameOverlayScreenshotNotification" "0">> localconfig.tmp
- ECHO/ "InGameOverlayScreenshotPlaySound" "1">> localconfig.tmp
- ECHO/ "InGameOverlayScreenshotSaveUncompressed" "0">> localconfig.tmp
- ECHO/ "JumplistSettings" "7744">> localconfig.tmp
- ECHO/ "JumplistSettingsKnown" "65535">> localconfig.tmp
- ECHO/ "NavUrlBar" "1">> localconfig.tmp
- ECHO/ "PushToTalkKey" "145">> localconfig.tmp
- ECHO/ "UsePushToTalk" "1">> localconfig.tmp
- ECHO/ }>> localconfig.tmp
- ECHO/}>> localconfig.tmp
- SET "FOUNDLINE=1"
- )
- IF !FOUNDLINE! EQU 0 ECHO/%%I>> localconfig.tmp
- )
- CALL :VBDOS2UNIX "%LCDIR%\localconfig.tmp" "%LCDIR%\localconfig.vdf"
- DEL /F /Q "%LCDIR%\localconfig.tmp"
- GOTO :eof
- ::END.DOTA_OPTIMIZE_STEAM
- :DOTA_OPTIMIZE_GAME
- CALL :XECHO Optimize Dota cvars and video options
- CD /D "%STEAMPATH%\userdata"
- FOR /f "tokens=1* delims=/ eol=?" %%I IN ('DIR /-b/-s config.cfg^|FINDSTR /l ":"^|FINDSTR /l /v "^ & %% !!"') DO IF EXIST "%%~I" DEL /F /Q "%%~I" >nul 2>&1
- IF NOT EXIST "%DOTAPATH%\dota\cfg\*" MD "%DOTAPATH%\dota\cfg" >nul 2>&1
- CD /D "%DOTAPATH%\dota\cfg"
- DEL /F /Q "config.cfg" >nul 2>&1
- DEL /F /Q "video.txt*" >nul 2>&1
- :: testrun dota to initiate video options
- START "" steam://open/minigameslist
- CALL :VBTIMESTAMP
- CALL :WAIT_FOR_STEAM
- START "" "%STEAMPATH%\Steam.exe" -applaunch 570 -low -dev -condebug -nosound -textmode -windowed -w 1280 -h 720 +sv_lan 1
- CALL :VBTIMESTAMP
- CALL :WAIT_FOR_DOTA
- TASKKILL /F /IM Steam.exe /T >nul 2>&1
- CALL :XWAIT 5
- :: alter video.txt
- IF NOT EXIST video.txt GOTO :eof
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L fullscreen "video.txt"') DO SET /A "fullscreen=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L nowindowborder "video.txt"') DO SET /A "nowindowborder=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L mat_vsync "video.txt"') DO SET /A "mat_vsync=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L defaultres\^" "video.txt"') DO SET /A "defaultres=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L defaultresheight "video.txt"') DO SET /A "defaultresheight=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L mat_viewportscale "video.txt"') DO SET /A "mat_viewportscale=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L r_shadow_half_update_rate "video.txt"') DO SET /A "r_shadow_half_update_rate=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L dota_cheap_water "video.txt"') DO SET /A "dota_cheap_water=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L r_deferred_height_fog "video.txt"') DO SET /A "r_deferred_height_fog=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L r_deferred_simple_light "video.txt"') DO SET /A "r_deferred_simple_light=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L r_ssao "video.txt"') DO SET /A "r_ssao=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L cl_globallight_shadow_mode "video.txt"') DO SET /A "cl_globallight_shadow_mode=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L r_screenspace_aa "video.txt"') DO SET /A "r_screenspace_aa=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L r_deferred_additive_pass "video.txt"') DO SET /A "r_deferred_additive_pass=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L dota_portrait_animate "video.txt"') DO SET /A "dota_portrait_animate=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L r_deferred_specular_bloom "video.txt"') DO SET /A "r_deferred_specular_bloom=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L r_deferred_specular "video.txt"') DO SET /A "r_deferred_specular=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L dota_ambient_creatures\^" "video.txt"') DO SET /A "dota_ambient_creatures=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L dota_ambient_creatures_pop "video.txt"') DO SET /A "dota_ambient_creatures_pop=%%I"
- FOR /f "tokens=1 delims=: eol=?" %%I IN ('FINDSTR /N /L mat_picmip "video.txt"') DO SET /A "mat_picmip=%%I"
- FOR /F "TOKENS=1,2* DELIMS=[]" %%H IN ('TYPE "video.txt" ^| FIND /V /N ""') DO (
- SET "FOUNDLINE=0"
- IF [%%H]==[%fullscreen%] ECHO/ "setting.fullscreen" "0">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%nowindowborder%] ECHO/ "setting.nowindowborder" "1">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%mat_vsync%] ECHO/ "setting.mat_vsync" "0">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%defaultres%] ECHO/ "setting.defaultres" "1280">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%defaultresheight%] ECHO/ "setting.defaultresheight" "720">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%mat_viewportscale%] ECHO/ "setting.mat_viewportscale" "0.9">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%r_shadow_half_update_rate%] ECHO/ "setting.r_shadow_half_update_rate" "1">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%dota_cheap_water%] ECHO/ "setting.dota_cheap_water" "1">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%r_deferred_height_fog%] ECHO/ "setting.r_deferred_height_fog" "0">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%r_deferred_simple_light%] ECHO/ "setting.r_deferred_simple_light" "1">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%r_ssao%] ECHO/ "setting.r_ssao" "0">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%cl_globallight_shadow_mode%] ECHO/ "setting.cl_globallight_shadow_mode" "2">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%r_screenspace_aa%] ECHO/ "setting.r_screenspace_aa" "0">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%r_deferred_additive_pass%] ECHO/ "setting.r_deferred_additive_pass" "0">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%dota_portrait_animate%] ECHO/ "setting.dota_portrait_animate" "1">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%r_deferred_specular_bloom%] ECHO/ "setting.r_deferred_specular_bloom" "0">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%r_deferred_specular%] ECHO/ "setting.r_deferred_specular" "0">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%dota_ambient_creatures%] ECHO/ "setting.dota_ambient_creatures" "0">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%dota_ambient_creatures_pop%] ECHO/ "setting.dota_ambient_creatures_pop" "1">> video.txt.tmp &SET "FOUNDLINE=1"
- IF [%%H]==[%mat_picmip%] ECHO/ "setting.mat_picmip" "0">> video.txt.tmp &SET "FOUNDLINE=1"
- IF !FOUNDLINE! EQU 0 ECHO/%%I>> video.txt.tmp
- )
- RENAME video.txt video.txt.def >nul 2>&1
- RENAME video.txt.tmp video.txt >nul 2>&1
- GOTO :eof
- :WAIT_FOR_STEAM
- ECHO Waiting for Steam window...
- CALL :XWAIT 4
- TASKLIST /FI "WINDOWTITLE eq Steam" /FI "STATUS eq running"|FINDSTR Steam.exe
- IF [%ERRORLEVEL%]==[0] (SET "STEAMRUNS=1") ELSE SET "STEAMRUNS="
- IF EXIST "%DOTAPATH%\dota\cfg\video.txt" GOTO :eof
- :: added 2 minutes timeout so it wont hang the script
- IF DEFINED TIMESTAMP CALL :VBTIMEDIFF "%TIMESTAMP%"
- IF DEFINED TIMEDIFF IF %TIMEDIFF% GTR 120 GOTO :eof
- IF NOT DEFINED STEAMRUNS ECHO Waiting for Steam window... &GOTO :WAIT_FOR_STEAM
- CALL :XWAIT 8
- GOTO :eof
- :WAIT_FOR_DOTA
- ECHO Waiting for Dota window...
- CALL :XWAIT 4
- TASKLIST /FI "WINDOWTITLE eq %DOTAPATH%\dota.exe" /FI "STATUS eq running"|FINDSTR dota.exe
- IF [%ERRORLEVEL%]==[0] (SET "DOTARUNS=1") ELSE SET "DOTARUNS="
- IF NOT DEFINED DOTARUNS (
- TASKLIST /FI "WINDOWTITLE eq DOTA 2" /FI "STATUS eq running"|FINDSTR dota.exe
- IF [%ERRORLEVEL%]==[0] (SET "DOTARUNS=1") ELSE SET "DOTARUNS="
- )
- IF EXIST "%DOTAPATH%\dota\cfg\video.txt" GOTO :eof
- :: added 2 minutes timeout so it wont hang the script
- IF DEFINED TIMESTAMP CALL :VBTIMEDIFF "%TIMESTAMP%"
- IF DEFINED TIMEDIFF IF %TIMEDIFF% GTR 120 GOTO :eof
- IF NOT DEFINED DOTARUNS ECHO Waiting for Dota window... &GOTO :WAIT_FOR_DOTA
- GOTO :eof
- ::END.DOTA_OPTIMIZE_GAME
- :DOTA_CLEANUP_DUMPS
- CALL :XECHO Cleanup old memory dumps
- SET /A STEAMDUMPCOUNT=0 &FOR %%C IN ("%STEAMPATH%\dumps\*.*") DO SET /A STEAMDUMPCOUNT+=1
- DEL /F /Q "%STEAMPATH%\dumps\*.*" >nul 2>&1
- SET /A DOTADUMPCOUNT=0 &FOR %%C IN ("%DOTAPATH%\dota_*.mdmp") DO SET /A DOTADUMPCOUNT+=1
- DEL /F /Q "%DOTAPATH%\dota_*.mdmp" >nul 2>&1
- CALL :XECHO Removed %STEAMDUMPCOUNT% dumps from Steam and %DOTADUMPCOUNT% dumps from Dota
- :: Remove dll's tampering with dota
- DEL /F /Q "%DOTAPATH%\dxgi.dll" >nul 2>&1
- DEL /F /Q "%DOTAPATH%\d3d9.dll" >nul 2>&1
- GOTO :eof
- ::END.DOTA_CLEANUP_DUMPS
- :DOTA_REMOVE_VPKMODS_FORCES_VERIFY
- CALL :XECHO Remove Override_vpk mods, and save them to _BACKUP folder
- CD /D "%DOTAPATH%\dota"
- MD _BACKUP >nul 2>&1
- :: removal was too drastical, this way it wont break sound if verify does not finish
- rem FOR %%I IN (cache_*.soc *.cache) DO DEL /F /Q %%I >nul 2>&1
- rem FOR %%I IN (materials models particles resource\flash3 scripts sound) DO (
- FOR %%I IN (materials models particles scripts) DO (
- IF EXIST %%I IF NOT EXIST _BACKUP\%%I\* MOVE /Y %%I _BACKUP\ >nul 2>&1
- IF EXIST %%I IF EXIST _BACKUP\%%I\* ROBOCOPY %%I\ _BACKUP\%%I\ /E /IS /MOVE /NFL /NDL /NJH /NJS /nc /ns /np
- )
- IF NOT EXIST _BACKUP\* RMDIR /S /Q _BACKUP
- CALL :XECHO Verifying integrity of game cache for Dota, please let it finish!
- START /WAIT "" steam://validate/570
- CALL :XWAIT 5
- GOTO :eof
- ::END.DOTA_REMOVE_VPKMODS_FORCES_VERIFY
- ::::::::::::::::::::::::::::::::::::::
- :: BATCH SCRIPT INTERNAL FUNCTIONS ::
- ::::::::::::::::::::::::::::::::::::::
- :XWAIT
- PING -n %1 127.0.0.1 >nul 2>&1
- GOTO :eof
- ::END.XWAIT
- :XDONE
- echo/
- echo/===========================================================
- echo/DONE: %*
- echo/
- IF DEFINED _TRACE echo Press any key to quit &PAUSE >nul &EXIT
- CALL :XWAIT 20 &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
- CALL :XWAIT 2
- GOTO :eof
- ::END.XECHO
- :XTITLE
- echo/
- IF NOT "%1_"=="_" echo/===========================================================
- IF NOT "%1_"=="_" echo/ %*
- IF NOT "%1_"=="_" echo/===========================================================
- SET /A _nline=1
- GOTO :eof
- ::END.XTITLE
- :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.4b
- 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
- rem 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}
- CD /D "%~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
- GOTO :eof
- ::END.CHECK_OS
- :VBDOS2UNIX
- :: converts line endings for small text files from dos CR+LF to unix LF
- :: Usage: :VBDOS2UNIX filesource fileoutput
- FINDSTR "'~1337v%skip%bd%skip%2u" "%~f0">"%temp%\~1337d2u.vbs"
- CSCRIPT //nologo "%temp%\~1337d2u.vbs" "%~1" "%~2"
- GOTO :eof
- On Error Resume Next '~1337vbcf '~1337vbd2u
- Set Fso = wscript.CreateObject("Scripting.FileSystemObject") '~1337vbd2u
- Set dos2unix=fso.OpenTextFile(WScript.Arguments(0), 1, true) '~1337vbd2u
- s=replace(dos2unix.ReadAll,vbCrLf,vbLf) '~1337vbd2u
- dos2unix.Close '~1337vbd2u
- Set dos2unix=fso.OpenTextFile(WScript.Arguments(1), 2, true) '~1337vbd2u
- dos2unix.Write s '~1337vbd2u
- dos2unix.Close '~1337vbd2u
- Set dos2unix=Nothing '~1337vbd2u
- Set Fso=Nothing '~1337vbd2u
- Err.Clear '~1337vbd2u
- ::END.VBDOS2UNIX
- :VBTIMESTAMP
- :: adds new variable TIMESTAMP having the current date and time
- :: Usage: CALL :VBTIMESTAMP
- FINDSTR "'~1337ti%skip%s" "%~f0">"%temp%\~1337tis.vbs"
- CALL CSCRIPT //nologo "%temp%\~1337tis.vbs" >"%temp%\~1337tis.cmd"
- CALL "%temp%\~1337tis.cmd" &DEL /F /Q "%temp%\~1337tis.vbs"
- DEL /F /Q "%temp%\~1337tis.cmd"
- goto :EOF
- On Error Resume Next '~1337tis
- WScript.echo "SET TIMESTAMP=" & Now '~1337tis
- Err.Clear '~1337tis
- ::END.VBTIMESTAMP
- :VBTIMEDIFF
- :: adds new variable TIMEDIFF having nr. of seconds between %TIMESTAMP% and now
- :: Usage: CALL :VBTIMEDIFF "%TIMESTAMP%"
- FINDSTR "'~1337ti%skip%d" "%~f0">"%temp%\~1337tid.vbs"
- CALL CSCRIPT //nologo "%temp%\~1337tid.vbs" %1>"%temp%\~1337tid.cmd"
- CALL "%temp%\~1337tid.cmd" &DEL /F /Q "%temp%\~1337tid.vbs"
- DEL /F /Q "%temp%\~1337tid.cmd"
- goto :EOF
- On Error Resume Next '~1337tid
- WScript.echo "SET TIMEDIFF=" & DateDiff("s",Wscript.Arguments(0),Now) '~1337tid
- Err.Clear '~1337tid
- ::END.VBTIMEDIFF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement