Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(1 Kb)
Download
Updated: 09-17-12 04:59 AM
Pictures
File Info
Compatibility:
Escalation (5.3)
Thunder Isle (5.2)
Landfall (5.1)
Mists of Pandaria (5.0.4)
Updated:09-17-12 04:59 AM
Created:09-11-12 04:40 PM
Downloads:1,115
Favorites:13
MD5:
WoW Cache Clearer
Version: 2.0
by: Tondef [More]
This is a batch file that I wrote to do some quick clean ups everyday before I fire WoW up.

What it does:
  1. Moves your Combat Log to a new folder and renames it to the current Year_Month_Day_WoWCombatLog.txt
    (makes log parsing a little easier)
  2. Moves your Chat Log to a new folder and renames it to the current Year_Month_Day_WoWChatLog.txt
    (just so that my chat log is only todays chat)
  3. Deletes your Creature Cache so that NPCScan will alert you to all rares everyday
  4. Moves your screenshots to a new folder
    (because I like to keep the WoW directory as clear as I can)

Zip file attached, but it is just as easy to copy the below text to a text editor and save as a .bat file.
Create a new text document on your desktop. Double click the file – it should be blank inside. Now, go to file>save as, and in the “Save As” window, input a name for your BAT file and then add a “.bat” on the end (without the quotes).
You will need to edit Lines 4, 7-10 to make it work on your installation.
Have fun.

Code:
@ECHO OFF
REM Change the following to your specific file locations
REM WoW install directory
SET WoW="C:\World of Warcraft"

REM These directories are where you want to save the output files to Dirve Letter\directory
SET EventLog="E:\WoWLogs\"
SET CombatLog="E:\WoWLogs\CombatLogs\"
SET ChatLog="E:\WoWLogs\ChatLogs\"
SET ScreenShot="E:\WoWLogs\Screenshots"
REM Adjust this line to the languge used in your WoW install
SET Language="enUS"

REM You should be able to leave the rest of this alone.

ECHO Welcome. Today is %DATE%.  
ECHO.
ECHO The WoW Directory is %WoW%
ECHO The Combat Log Directory is %CombatLog% 
ECHO The Chat Log Directory is %ChatLog%.
ECHO Screenshots will be moved to %ScreenShot%
ECHO Your WoW client is using %Language%
ECHO.
ECHO If a Creature Cache exists it will be deleted to allow NPC Scan to work correctly.
Pause
ECHO.

CD /D %WoW%

REM Clear the Creature Cache for NPC Scan
IF EXIST ".\Cache\WDB\%Language%\creaturecache.wdb" (
   DEL /S /Q ".\Cache\WDB\%Language%\creaturecache.wdb"
   ECHO Creature Cache Deleted.
   ) ELSE ECHO No Creature Cache Found.

REM Setting DTG and counters
SET Today=%Date: =0%
SET Year=%Today:~-4%
SET Month=%Today:~-10,2%
SET Day=%Today:~-7,2%
SET ChangeCount=0
SET AppendCount=0

REM CombatLog Rename and Move/Append 
IF EXIST ".\Logs\WoWcombatlog.txt" (
   RENAME ".\Logs\WoWcombatlog.txt" %Year%_%Month%_%Day%_WoWCombatLog.txt
   SET /a ChangeCount=%ChangeCount%+1
   IF EXIST %CombatLog%"%Year%_%Month%_%Day%_WoWcombatlog.txt" (
      GOTO CombatAppend
      ) ELSE (
      MOVE .\Logs\%Year%_%Month%_%Day%_WoWCombatLog.txt %CombatLog%%Year%_%Month%_%Day%_WoWcombatlog.txt))

REM ChatLog Rename and Move/Append
IF EXIST ".\Logs\WoWchatlog.txt" (
   RENAME ".\Logs\WoWchatlog.txt" %Year%_%Month%_%Day%_WoWChatLog.txt
   SET /a ChangeCount=%ChangeCount%+1
   IF EXIST %ChatLog%"%Year%_%Month%_%Day%_WoWchatlog.txt" (
      GOTO ChatAppend
      ) ELSE (
      MOVE .\Logs\%Year%_%Month%_%Day%_WoWchatlog.txt %ChatLog%%Year%_%Month%_%Day%_WoWchatlog.txt))

REM Screenshot cleanup
IF EXIST .\Screenshots\*.jpg Move .\Screenshots\*.jpg %ScreenShot%

REM Final output
ECHO %DATE%:%ChangeCount% Log Files moved to Log Archives. >> %EventLog%EventLog.txt
ECHO %DATE%:%AppendCount% Logs were appended to existing log files. >> %EventLog%EventLog.txt
ECHO.
ECHO %ChangeCount% Log Files moved to Log Archives.
ECHO.
ECHO %AppendCount% Logs were appended to existing log files.
ECHO.
PAUSE
ECHO.
ECHO ------------------------------------
ECHO WoW will launch after next keypress.
ECHO ------------------------------------
ECHO.
PAUSE
START /high WoW.exe
EXIT 

REM Functions used above
:CombatAppend
ECHO. >> %CombatLog%%Year%_%Month%_%Day%_WoWcombatlog.txt
TYPE .\Logs\%Year%_%Month%_%Day%_WoWcombatlog_%Month%_%Day%_%Year%.txt >> %CombatLog%%Year%_%Month%_%Day%_WoWcombatlog.txt
DEL .\Logs\%Year%_%Month%_%Day%_WoWcombatlog.txt
SET /a %AppendCount%+=1

:ChatAppend
ECHO. >> %ChatLog%%Year%_%Month%_%Day%_WoWchatlog.txt
TYPE .\Logs\%Year%_%Month%_%Day%_WoWchatlog.txt >> %ChatLog%%Year%_%Month%_%Day%_WoWchatlog.txt
DEL .\Logs\%Year%_%Month%_%Day%_WoWchatlog.txt
SET /a %AppendCount%+=1
20120917 - Modified changedir command to use /d to correct for running batch file and WoW from different drives.
Optional Files (0)


Archived Files (1)
File Name
Version
Size
Author
Date
1.0
1kB
Tondef
09-11-12 04:40 PM


Post A Reply Comment Options
Unread 05-07-13, 01:56 AM  
bossmansmith
A Murloc Raider

Forum posts: 4
File comments: 73
Uploads: 0
I liked this idea however it seems that it get stuck when trying to launch a 2nd version of the game while one is already running. I assume it has something to do with being unable to rename Chatlog and CombatLog while logged into game and the batch file not handling the error well enough to launch the game when this happens. Any chance of it getting a fix?

Manged to create this file that just errors on a rename since the renamed file stays in same folder:
@ECHO OFF
D:
cd \World of Warcraft\Cache\WDB\enUS
if exist creaturecache.old del creaturecache.old
if exist creaturecache.wdb ren creaturecache.wdb creaturecache.old
cd \World of Warcraft\Logs\
if exist WoWCombatLog.txt ren WoWCombatLog.txt %Date:~10,4%-%Date:~4,2%-%Date:~7,2%-Combatlog.txt
if exist WoWChatLog.txt ren WoWChatLog.txt %Date:~10,4%-%Date:~4,2%-%Date:~7,2%-Chatlog.txt
@start D:\"World of Warcraft"\"Wow-64.exe"

I really like the idea of moving the logs to another folder but am unsure how i could impement that with proper error handling to allow the bat file to continue once it hits the can't rename file in use.
bossmansmith is offline Report comment to moderator  
Reply With Quote
Unread 01-11-13, 11:31 AM  
Adrianna
A Kobold Labourer
 
Adrianna's Avatar

Forum posts: 0
File comments: 2
Uploads: 0
Wow 64 bit

Thank you for this

Also for those who can run 64 bit versions, you might want to change the line "Start /high Wow.exe" to "Start /high Wow-64.exe"
Adrianna is offline Report comment to moderator  
Reply With Quote
Unread 09-17-12, 04:57 AM  
Tondef
An Aku'mai Servant
 
Tondef's Avatar
AddOn Author - Click to view AddOns

Forum posts: 39
File comments: 56
Uploads: 4
I added in a variable for the language. It doesn't make a huge difference as the language is only on the screenshot line, but it might make it easier to modify if other files are moved later.

Thanks for the feedback.

Originally Posted by Hypnotica
Nice batch file.

i used an german client, so i modified it to

Code:
REM Clear the Creature Cache for german NPC Scan
IF EXIST ".\Cache\WDB\deDE\creaturecache.wdb" (
   DEL /S /Q ".\Cache\WDB\deDE\creaturecache.wdb"
   ECHO Creature Cache Deleted.
   ) ELSE ECHO No Creature Cache Found.
__________________
The strength of the wolf is the pack, and the strength of the pack is the wolf.
Tondef is offline Report comment to moderator  
Reply With Quote
Unread 09-17-12, 04:47 AM  
Tondef
An Aku'mai Servant
 
Tondef's Avatar
AddOn Author - Click to view AddOns

Forum posts: 39
File comments: 56
Uploads: 4
Thanks! Added to the script code.
I run them doth from the same drive so missed that.

Originally Posted by glupikreten
The code does not work if you got WOW installed on any other drive besides the drive you start batch file from...

You should instead of

CD %WoW%

do

CD /d %WoW%
__________________
The strength of the wolf is the pack, and the strength of the pack is the wolf.
Tondef is offline Report comment to moderator  
Reply With Quote
Unread 09-12-12, 07:09 AM  
glupikreten
A Murloc Raider

Forum posts: 4
File comments: 62
Uploads: 0
The code does not work if you got WOW installed on any other drive besides the drive you start batch file from...

You should instead of

CD %WoW%

do

CD /d %WoW%
Last edited by glupikreten : 09-12-12 at 07:15 AM.
glupikreten is offline Report comment to moderator  
Reply With Quote
Unread 09-12-12, 12:13 AM  
Hypnotica
A Murloc Raider

Forum posts: 4
File comments: 26
Uploads: 0
Nice batch file.

i used an german client, so i modified it to

Code:
REM Clear the Creature Cache for german NPC Scan
IF EXIST ".\Cache\WDB\deDE\creaturecache.wdb" (
   DEL /S /Q ".\Cache\WDB\deDE\creaturecache.wdb"
   ECHO Creature Cache Deleted.
   ) ELSE ECHO No Creature Cache Found.
Hypnotica is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: