SHARE
TWEET

reset_Dota2_Test

aveyo Dec 11th, 2016 (edited) 504 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off &color 0B &mode 112,16 &title Dota 2 Test - reset local and remote Cloud settings by AveYo, v3
  2. rem v2 changes: don't reset settings hotkeys, control groups and user mutes;  v3 changes: 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 Test, chose "Upload" at the Cloud Sync Conflict prompt then "Play Game"
  9. echo  4. Adjust your settings, then restart Dota 2 Test. Did it stick? Repeat procedure with Cloud On and Off
  10. echo.
  11. setlocal &call :set_dota
  12. if not defined STEAMDATA echo Error! Cannot find Dota 2 Test 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 test
  20. del /f /q "%STEAMDATA%\205790\remotecache.vdf" >nul 2>nul
  21. copy /y "%STEAMDATA%\205790\remote\cfg\dotakeys_personal.lst" "%DOTA%\game\dota\cfg" >nul 2>nul
  22. cd/d "%STEAMDATA%\205790"
  23. for /f "usebackq tokens=*" %%a in (`dir /a:-D /b /s ^| findstr /l /i /v ".png .jpg control_groups.txt voice_ban.dt"`) do cd.>"%%a"
  24. copy /y "%DOTA%\game\dota\cfg\dotakeys_personal.lst" "%STEAMDATA%\205790\remote\cfg\dotakeys_personal.lst" >nul 2>nul
  25. cd/d "%DOTA%\game\dota\cfg"
  26. for /f "usebackq tokens=*" %%a in (`dir /a:-D /b ^| findstr /l /i /v ".cfg .lst"`) do del /f/q "%%a" >nul 2>nul
  27. ren autoexec.cfg saved_autoexec.cfg >nul 2>nul
  28. set ukd="%DOTA%\game\dota\cfg\user_keys_default.vcfg"
  29.  > %ukd% echo/"config"
  30. >> %ukd% echo/{
  31. >> %ukd% echo/  "bindings"
  32. >> %ukd% echo/  {
  33. >> %ukd% echo/      "\" "toggleconsole"
  34. >> %ukd% echo/  }
  35. >> %ukd% echo/}
  36. del /f/s/q "%DOTA%\game\dota\core" >nul 2>nul &rmdir /s/q "%DOTA%\game\dota\core" >nul 2>nul
  37. del /f/s/q "%DOTA%\game\core\cfg\*.json" >nul 2>nul
  38. del /f/s/q "%DOTA%\game\core\cfg\*.bin" >nul 2>nul
  39. start "w" steam://rungameid/205790
  40. timeout /t 25 >nul
  41. echo  DONE! You can close this window now
  42. pause >nul
  43. endlocal &exit /b
  44. ::
  45. : [ Batch utility ]
  46. :set_dota outputs %STEAMPATH% %STEAMDATA% %STEAMID% %STEAMAPPS% %DOTA%                              
  47. set "STEAMPATH=D:\Steam" &set "DOTA=D:\Games\steamapps\common\dota 2 test"          ||:i AveYo:" Override detection here if needed "
  48. if not exist "%STEAMPATH%\Steam.exe" call :reg_query "HKCU\SOFTWARE\Valve\Steam" "SteamPath" STEAMPATH
  49. set "STEAMDATA=" &if defined STEAMPATH for %%# in ("%STEAMPATH:/=\%") do set "STEAMPATH=%%~dpnx#"     ||:i  / pathsep on Windows lul
  50. if not exist "%STEAMPATH%\Steam.exe" call :end ! Cannot find SteamPath in registry
  51. call :reg_query "HKCU\SOFTWARE\Valve\Steam\ActiveProcess" "ActiveUser" ACTIVEUSER &set /a "STEAMID=ACTIVEUSER" >nul 2>nul
  52. if exist "%STEAMPATH%\userdata\%STEAMID%\config\localconfig.vdf" set "STEAMDATA=%STEAMPATH%\userdata\%STEAMID%"
  53. if not defined STEAMDATA for /f "delims=" %%# in ('dir "%STEAMPATH%\userdata" /b/o:d/t:w/s 2^>nul') do set "ACTIVEUSER=%%~dp#"
  54. if not defined STEAMDATA for /f "delims=\" %%# in ("%ACTIVEUSER:*\userdata\=%") do set "STEAMID=%%#"
  55. if exist "%STEAMPATH%\userdata\%STEAMID%\config\localconfig.vdf" set "STEAMDATA=%STEAMPATH%\userdata\%STEAMID%"
  56. if exist "%DOTA%\game\dota\maps\dota.vpk" set "STEAMAPPS=%DOTA:\common\dota 2 test=%" &exit/b
  57. set "libfilter=LibraryFolders { TimeNextStatsReport ContentStatsID }"
  58. if not exist "%STEAMPATH%\SteamApps\libraryfolders.vdf" call :end ! Cannot find "%STEAMPATH%\SteamApps\libraryfolders.vdf"
  59. for /f usebackq^ delims^=^"^ tokens^=4 %%s in (`findstr /v "%libfilter%" "%STEAMPATH%\SteamApps\libraryfolders.vdf"`) do (
  60. if exist "%%s\steamapps\appmanifest_205790.acf" if exist "%%s\steamapps\common\dota 2 test\game\dota\maps\dota.vpk" set "libfs=%%s")
  61. set "STEAMAPPS=%STEAMPATH%\steamapps" &if defined libfs set "STEAMAPPS=%libfs:\\=\%\steamapps"
  62. if not exist "%STEAMAPPS%\common\dota 2 test\game\dota\maps\dota.vpk" call :end ! Cannot find "%STEAMAPPS%\common\dota 2 test"
  63. set "DOTA=%STEAMAPPS%\common\dota 2 test"
  64. exit/b
  65. :reg_query %1:KeyName %2:ValueName %3:OutputVariable %4:other_options[example: "/t REG_DWORD"]
  66. setlocal &for /f "skip=2 delims=" %%s in ('reg query "%~1" /v "%~2" /z 2^>nul') do set "rq=%%s" &call set "rv=%%rq:*)    =%%"
  67. endlocal &call set "%~3=%rv%" &exit/b                            ||:i AveYo - Usage:" call :reg_query "HKCU\MyKey" "MyValue" MyVar "
  68. :end %1:Message[Delayed termination with status message - prefix with ! to signal failure]
  69. echo. &if "%~1"=="!" ( color 4f & echo ERROR%* &timeout /t 32 &exit ) else echo  %* &timeout /t 20 &exit
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top