Advertisement
aveyo

reset_Dota2

Apr 28th, 2016
8,412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 4.47 KB | None | 0 0
  1. @echo off &color 0B &mode 112,16 &title Dota 2 - reset local and remote Cloud settings by AveYo, v3.1
  2. rem v3.1 changes: don't reset herobuilds.cfg, settings hotkeys, control groups and user mutes; improved detection, print steamid
  3. echo. & echo. & echo.
  4. echo     INSTRUCTIONS:
  5. echo  1. Make sure you launch the game at least once with the account having troubles,
  6. echo     else this script will use the last logged on account
  7. echo  2. Run this script - you might need to right-click it and Run as Administrator
  8. echo  3. After launching Dota 2, chose "Upload" at the Cloud Sync Conflict prompt then "Play Game"
  9. echo  4. Adjust your settings, then restart Dota 2. Did it stick? Repeat procedure with Cloud On and Off
  10. echo.
  11. setlocal &call :set_steam_dota
  12. if not defined STEAMDATA echo Error! Cannot find Dota 2 user profile &pause &exit /b
  13. echo  STEAMID = %STEAMID% & echo. & echo.
  14. taskkill /t /f /im dota2.exe >nul 2>nul
  15. taskkill /t /f /im steam.exe >nul 2>nul
  16. takeown /f "%STEAMDATA%" /r /d y >nul 2>nul
  17. icacls "%STEAMDATA%" /reset /t /q >nul 2>nul
  18. attrib -r "%STEAMDATA%" /s /d >nul 2>nul
  19. :: dota 2
  20. del /f /q "%STEAMDATA%\570\remotecache.vdf" >nul 2>nul
  21. copy /y "%STEAMDATA%\570\remote\cfg\dotakeys_personal.lst" "%DOTA%\dota\cfg" >nul 2>nul
  22. cd/d "%STEAMDATA%\570"
  23. set "filter=.png .jpg control_groups.txt herobuilds.cfg voice_ban.dt"
  24. for /f "usebackq tokens=*" %%a in (`dir /a:-D /b /s ^| findstr /l /i /v "%filter%"`) do cd.>"%%a"
  25. copy /y "%DOTA%\dota\cfg\dotakeys_personal.lst" "%STEAMDATA%\570\remote\cfg\dotakeys_personal.lst" >nul 2>nul
  26. cd/d "%DOTA%\dota\cfg"
  27. for /f "usebackq tokens=*" %%a in (`dir /a:-D /b ^| findstr /l /i /v ".cfg .lst"`) do del /f/q "%%a" >nul 2>nul
  28. ren autoexec.cfg saved_autoexec.cfg >nul 2>nul
  29. pause
  30. set ukd="%DOTA%\dota\cfg\user_keys_default.vcfg"
  31.  > %ukd% echo/"config"
  32. >> %ukd% echo/{
  33. >> %ukd% echo/  "bindings"
  34. >> %ukd% echo/  {
  35. >> %ukd% echo/      "\" "toggleconsole"
  36. >> %ukd% echo/  }
  37. >> %ukd% echo/}
  38. del /f/s/q "%DOTA%\dota\core" >nul 2>nul &rmdir /s/q "%DOTA%\dota\core" >nul 2>nul
  39. del /f/s/q "%DOTA%\core\cfg\*.json" >nul 2>nul
  40. del /f/s/q "%DOTA%\core\cfg\*.bin" >nul 2>nul
  41. start "w" steam://rungameid/570
  42. timeout /t 25 >nul
  43. echo  DONE! You can close this window now
  44. pause >nul
  45. endlocal &exit /b
  46. ::
  47. rem Utils
  48. :set_steam_dota outputs %STEAMPATH% %STEAMID% %STEAMDATA% %STEAMAPPS% %DOTA% %CONTENT%
  49. set "STEAMPATH=D:\Steam" &set "DOTA=D:\Games\steamapps\common\dota 2 beta\game"      &rem AveYo:" Override detection if needed "
  50. if not exist "%STEAMPATH%\Steam.exe" call :reg_query STEAMPATH "HKCU\SOFTWARE\Valve\Steam" "SteamPath"
  51. set "STEAMDATA=" & if defined STEAMPATH for %%# in ("%STEAMPATH%") do set "STEAMPATH=%%~dpnx#"
  52. if not exist "%STEAMPATH%\Steam.exe" call :end ! Cannot find SteamPath in registry
  53. call :reg_query ACTIVEUSER "HKCU\SOFTWARE\Valve\Steam\ActiveProcess" "ActiveUser" & set/a "STEAMID=ACTIVEUSER" >nul 2>nul
  54. if exist "%STEAMPATH%\userdata\%STEAMID%\config\localconfig.vdf" set "STEAMDATA=%STEAMPATH%\userdata\%STEAMID%"
  55. if not defined STEAMDATA for /f "delims=" %%# in ('dir "%STEAMPATH%\userdata" /b/o:d/t:w/s 2^>nul') do set "ACTIVEUSER=%%~dp#"
  56. if not defined STEAMDATA for /f "delims=\" %%# in ("%ACTIVEUSER:*\userdata\=%") do set "STEAMID=%%#"
  57. if exist "%STEAMPATH%\userdata\%STEAMID%\config\localconfig.vdf" set "STEAMDATA=%STEAMPATH%\userdata\%STEAMID%"
  58. if exist "%DOTA%\dota\maps\dota.vpk" set "STEAMAPPS=%DOTA:\common\dota 2 beta=%" & exit/b
  59. set "libfilter=LibraryFolders { TimeNextStatsReport ContentStatsID }"
  60. if not exist "%STEAMPATH%\SteamApps\libraryfolders.vdf" call :end ! Cannot find "%STEAMPATH%\SteamApps\libraryfolders.vdf"
  61. for /f usebackq^ delims^=^"^ tokens^=4 %%s in (`findstr /v "%libfilter%" "%STEAMPATH%\SteamApps\libraryfolders.vdf"`) do (
  62. if exist "%%s\steamapps\appmanifest_570.acf" if exist "%%s\steamapps\common\dota 2 beta\game\dota\maps\dota.vpk" set "libfs=%%s")
  63. set "STEAMAPPS=%STEAMPATH%\steamapps" & if defined libfs set "STEAMAPPS=%libfs:\\=\%\steamapps"
  64. if not exist "%STEAMAPPS%\common\dota 2 beta\game\dota\maps\dota.vpk" call :end ! Missing "%STEAMAPPS%\common\dota 2 beta\game"
  65. set "DOTA=%STEAMAPPS%\common\dota 2 beta\game" & set "CONTENT=%STEAMAPPS%\common\dota 2 beta\content"
  66. exit/b
  67. :reg_query [USAGE] call :reg_query ResultVar "HKCU\KeyName" "ValueName"
  68. (for /f "skip=2 delims=" %%s in ('reg query "%~2" /v "%~3" /z 2^>nul') do set ".=%%s" & call set "%~1=%%.:*)    =%%") & exit/b
  69. :end %1:Message
  70. if "%~1"=="!" ( color c0 &echo !ERROR%* &timeout /t 16 &color &exit ) else echo  %* &timeout /t 8 &color &exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement