Advertisement
aveyo

log_Dota2

Apr 29th, 2016
919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.63 KB | None | 0 0
  1. :: Dota 2 - log files needed for debugging unwanted settings reset (cc) AVEYO
  2. :: Procedure:
  3. :: 1. Add Dota 2 launch options: -condebug -conclearlog
  4. :: 2. Launch Dota 2
  5. :: 3. After closing Dota 2, run this script to gather configuration files in the LOG subfolder
  6. :: 4. Archive (.zip) the folder or just a particular run inside and share it on dev.dota2
  7.  
  8. @ECHO OFF &SETLOCAL ENABLEDELAYEDEXPANSION
  9. CALL :DETECT_STEAMPATH
  10. echo    %STEAMPATH%
  11. CALL :DETECT_DOTAPATH
  12. echo    %DOTAPATH%
  13. CALL :DETECT_USERPATH
  14. echo    %USERPATH%
  15. rem echo %STEAMID64%
  16.  
  17. FOR /F %%a IN ('WMIC OS GET LocalDateTime ^| FIND "."') DO SET DTS=%%a
  18. SET DateTime=%DTS:~0,4%-%DTS:~4,2%-%DTS:~6,2%_%DTS:~8,2%-%DTS:~10,2%-%DTS:~12,2%
  19.  
  20. XCOPY "%USERPATH%\570\*" "%~dp0LOG\%DateTime%\570\" /C /E /I /Q /S /Y
  21. XCOPY "%DOTAPATH%\dota\cfg\*" "%~dp0LOG\%DateTime%\cfg\" /C /E /I /Q /S /Y
  22. COPY /Y "%DOTAPATH%\dota\console.log" "%~dp0LOG\%DateTime%\" >NUL 2>&1
  23. EXIT /B
  24. GOTO :eof
  25. ::END.MAIN
  26.  
  27. :DETECT_STEAMPATH
  28. :: search in default_path/filetypes/registry and save it in %STEAMPATH% var
  29. SET "STEAMPATH=C:\Program Files (x86)\Steam"
  30. IF EXIST "%STEAMPATH%\Steam.exe" IF EXIST "%STEAMPATH%\config\config.vdf" GOTO :eof
  31. FOR /F USEBACKQ^ TOKENS^=2^ DELIMS^=^" %%A IN (`FTYPE steam 2^>nul`) DO SET "STEAMPATH=%%~dpA"
  32. SET "STEAMPATH=%STEAMPATH:~,-1%"
  33. IF EXIST "%STEAMPATH%\Steam.exe" GOTO :eof
  34. :: Valve why do you use Linux paths under Windows?!
  35. FOR /F "usebackq tokens=2* delims=_" %%A IN (`REG QUERY "HKCU\SOFTWARE\Valve\Steam" 2^>nul ^| FIND /I "SteamPath"`) DO SET "STEAMPATH=%%~A"
  36. SET "STEAMPATH=%STEAMPATH:~6%"
  37. SET "STEAMPATH=%STEAMPATH:/=\%"
  38. SET "STEAMPATH=%STEAMPATH:\\=\%"
  39. IF EXIST "%STEAMPATH%\Steam.exe" GOTO :eof
  40. SET "STEAMPATH="
  41. GOTO :eof
  42. ::END.DETECT_STEAMPATH
  43.  
  44. :DETECT_DOTAPATH
  45. :: search in default_path/filetypes/steam_config/steam_library and save it in %DOTAPATH% var
  46. IF EXIST "!STEAMPATH!\SteamApps\appmanifest_570.acf" IF EXIST "!STEAMPATH!\steamapps\common\dota 2 beta\game\dota\maps\dota.vpk" SET "DOTAPATH=!STEAMPATH!\steamapps\common\dota 2 beta\game" &GOTO :eof
  47. FOR /F USEBACKQ^ TOKENS^=2^ DELIMS^=^" %%A IN (`FTYPE dota2 2^>nul`) DO CD /D "%%~dpA" >NUL 2>&1
  48. IF EXIST particles.dll CD /D ..\..\
  49. SET "DOTAPATH=!CD!"
  50. IF EXIST "!DOTAPATH!\dota\maps\dota.vpk" GOTO :eof
  51. :: damn Valve why don't you have a reg entry for library folders?
  52. FOR /F USEBACKQ^ DELIMS^=^"^ TOKENS^=4 %%A IN (`FINDSTR "BaseInstallFolder_" "!STEAMPATH!\config\config.vdf"`) DO (
  53. SET "APPPATH=%%A" &SET "APPPATH=!APPPATH:/=\!" &SET "APPPATH=!APPPATH:\\=\!"
  54. IF EXIST "!APPPATH!\appmanifest_570.acf" IF EXIST "!APPPATH!\steamapps\common\dota 2 beta\game\dota\maps\dota.vpk" SET "DOTAPATH=!APPPATH!\steamapps\common\dota 2 beta\game" &GOTO :eof
  55. )
  56. FOR /F USEBACKQ^ DELIMS^=^"^ TOKENS^=4 %%A IN (`FINDSTR /V "LibraryFolders { TimeNextStatsReport ContentStatsID }" "!STEAMPATH!\SteamApps\libraryfolders.vdf"`) DO (
  57. SET "APPPATH=%%A" &SET "APPPATH=!APPPATH:/=\!" &SET "APPPATH=!APPPATH:\\=\!"
  58. IF EXIST "!APPPATH!\steamapps\appmanifest_570.acf" IF EXIST "!APPPATH!\steamapps\common\dota 2 beta\game\dota\maps\dota.vpk" SET "DOTAPATH=!APPPATH!\steamapps\common\dota 2 beta\game" &GOTO :eof
  59. )
  60. SET "DOTAPATH="
  61. GOTO :eof
  62. ::END.DETECT_DOTAPATH
  63.  
  64. :DETECT_USERPATH
  65. :: search in %DOTAPATH%\game\dota\ and save it in %USERPATH% var - simpler this way, else it would require converting steamid and poking around steam config files
  66. CD /D "%DOTAPATH%\dota\" >NUL 2>&1
  67. FOR /F DELIMS^=^ EOL^= %%B IN ('DIR /A:-D /B /O:D /T:W cache_*.soc 2^>nul') DO SET "USERCACHE=%%~nB"
  68. SET "USERPATH=%STEAMPATH%\userdata\%USERCACHE:cache_=%"
  69. IF EXIST "%USERPATH%\config\localconfig.vdf" GOTO :eof
  70. SET "USERPATH="
  71. GOTO :eof
  72. ::END.DETECT_USERPATH
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement