View Single Post
05-16-17, 10:24 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
I wrote this Windows Command script a long time ago to get rid of extraneous backup files and abandoned saved variables.

Code:
@echo off
pushd "C:\Program Files (x86)\World of Warcraft\WTF\Account"

del /s *.bak
del /s *.old

for /d %%i in (*) do (
	if exist %%i\SavedVariables\ (
		echo Account: %%i

		for %%j in ("%%i\SavedVariables\*.lua") do (
			echo %%~nj | findstr /r /i "^Blizzard_" > nul
			if errorlevel 1 (
				echo GlobalSV: %%~nj
				if not exist ..\..\Interface\AddOns\%%~nj\ (
					echo Delete: %%~nj
					del "%%j"
				)
			)
		)

		for /d %%j in ("%%i\*") do (
			for /d %%k in ("%%j\*") do (
				echo Character: %%k
				for %%l in ("%%k\SavedVariables\*.lua") do (
					echo %%~nl | findstr /r /i "^Blizzard_" > nul
					if errorlevel 1 (
						echo CharSV: %%~nl
						if not exist ..\..\Interface\AddOns\%%~nl\ (
							echo Delete: %%~nl
							del "%%l"
						)
					)
				)
			)
		)
	)
)

popd
pause
It scans through the SavedVar directories and checks if each Lua file has a matching addon folder name. If it doesn't, the file is deleted.
Make sure the initial pushd is pointing to your WoW account directory. The path I used is the default.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 05-17-17 at 10:14 AM.
  Reply With Quote