Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: dota cleanup v1.0b by AveYo, all right reserved
- :: use this when you have missing resources errors in console (sounds, models)
- :: removes crash dumps
- :: moves residual files from custom mods (-override_vpk) into BACKUP folder
- :: then it calls verify integrity of game cache to restore defaults - wait for it to finish!
- @ECHO OFF
- :: Gain admin rights
- if "%1"=="_SELF_ADMIN" goto :_START
- echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\~1337run.vbs"
- echo UAC.ShellExecute "%~s0", "_SELF_ADMIN %~sdp0", "", "runas", 1 >> "%temp%\~1337run.vbs"
- CALL CSCRIPT //nologo "%temp%\~1337run.vbs" &DEL /F /Q "%temp%\~1337run.vbs" &EXIT /B
- :_START
- SHIFT
- ::
- :: get steam path
- FOR /F "tokens=3*" %%I IN ('REG QUERY "HKCU\SOFTWARE\Valve\Steam"^|FINDSTR /I /L "SteamPath"') DO SET "STEAMPATH=%%~I"
- SET "STEAMPATH=%STEAMPATH:/=\%"
- :: get 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 "DOTAEXE=%%~I"
- IF EXIST "%DOTAEXE%" FOR /F "tokens=*" %%I IN ("%DOTAEXE%") DO SET "CHECKDOTAPATH=%%~dpI"
- IF EXIST "%CHECKDOTAPATH%dota\pak01_dir.vpk" SET "DOTAPATH=%CHECKDOTAPATH:~0,-1%"
- :: Fallback to default steam path
- IF NOT DEFINED DOTAPATH SET "DOTAPATH=%STEAMPATH%\SteamApps\common\dota 2 beta"
- IF NOT EXIST "%DOTAPATH%\dota\pak01_dir.vpk" echo Dota not found, only Verifying integrity of game cache for Dota &START " " steam://validate/570 &pause &EXIT /B
- echo Dota found on [%DOTAPATH%], starting cleanup
- DEL /F /Q "%STEAMPATH%\dumps\*.*" >nul 2>&1
- DEL /F /Q "%DOTAPATH%\dota_*.mdmp" >nul 2>&1
- PUSHD "%DOTAPATH%\dota"
- MD BACKUP >nul 2>&1
- FOR %%I IN (materials models particles resource scripts sound) 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
- )
- FOR %%I IN (cache_*.soc *.cache) DO DEL /F /Q %%I >nul 2>&1
- echo Verifying integrity of game cache for Dota
- START " " steam://validate/570
- echo Please let "Validating Steam files" finish!
- PING -n 10 localhost >nul 2>&1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement