This is a batch file that I wrote to do some quick clean ups everyday before I fire WoW up.
What it does:
- 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)
- 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)
- Deletes your Creature Cache so that NPCScan will alert you to all rares everyday
- 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