@ECHO OFF

REM This script uses junction.exe to make 5 separate
REM copies of WoW that share the same WoW game data
REM files and addons. (The big files.)

REM Set WOWARCHIVE to a complete backup copy of the game w/Addons.

REM This will be copied to a 'root' master folder and the big game
REM alt/clone game folders will be hard linked to this root copy.

REM Each game instance can still have their own writable files and
REM directories. (WTF,Errors,Cache,Logs) etc...

REM Each game instance will share the game program data files and addons.

REM Note that junction.exe can only link directories and not files
REM so the top level WoW executables are copies. (couple meg, not bad.)

SET WOWARCHIVE=C:\WOWARCHIVE

SET WOWROOT=C:\WOWROOT
SET WOWDIR1=C:\WOW1
SET WOWDIR2=C:\WOW2
SET WOWDIR3=C:\WOW3
SET WOWDIR4=C:\WOW4
SET WOWDIR5=C:\WOW5

SET WOWDIRT=%WOWDIR1%

SET BACKUPDIR=C:\MultiBox\BACKUP2

SET JUNCTION=C:\Windows\System32\junction.exe

rd /s /q %BACKUPDIR%\WTF
mkdir %BACKUPDIR%\WTF
xcopy %WOWDIRT%\WTF\*.* %BACKUPDIR%\WTF /e /y /o /h /i /g /r /k /x

rd /s /q %WOWROOT%
rd /s /q %WOWDIR1%
rd /s /q %WOWDIR2%
rd /s /q %WOWDIR3%
rd /s /q %WOWDIR4%
rd /s /q %WOWDIR5%
md %WOWROOT%
md %WOWDIR1%
md %WOWDIR2%
md %WOWDIR3%
md %WOWDIR4%
md %WOWDIR5%

xcopy %WOWARCHIVE%\*.* %WOWROOT%\ /E

echo \Data\ > %WOWROOT%\excludes.txt
echo \Interface\ >> %WOWROOT%\excludes.txt
echo \WTF\ >> %WOWROOT%\excludes.txt
echo \excludes.txt\ >> %WOWROOT%\excludes.txt

xcopy %WOWROOT%\*.* %WOWDIR1% /E /EXCLUDE:%WOWROOT%\excludes.txt
xcopy %WOWROOT%\*.* %WOWDIR2% /E /EXCLUDE:%WOWROOT%\excludes.txt
xcopy %WOWROOT%\*.* %WOWDIR3% /E /EXCLUDE:%WOWROOT%\excludes.txt
xcopy %WOWROOT%\*.* %WOWDIR4% /E /EXCLUDE:%WOWROOT%\excludes.txt
xcopy %WOWROOT%\*.* %WOWDIR5% /E /EXCLUDE:%WOWROOT%\excludes.txt

%JUNCTION% %WOWDIR1%\Data %WOWROOT%\Data
%JUNCTION% %WOWDIR2%\Data %WOWROOT%\Data
%JUNCTION% %WOWDIR3%\Data %WOWROOT%\Data
%JUNCTION% %WOWDIR4%\Data %WOWROOT%\Data
%JUNCTION% %WOWDIR5%\Data %WOWROOT%\Data

%JUNCTION% %WOWDIR1%\Interface %WOWROOT%\Interface
%JUNCTION% %WOWDIR2%\Interface %WOWROOT%\Interface
%JUNCTION% %WOWDIR3%\Interface %WOWROOT%\Interface
%JUNCTION% %WOWDIR4%\Interface %WOWROOT%\Interface
%JUNCTION% %WOWDIR5%\Interface %WOWROOT%\Interface

echo Done. Follow up with fixwtf.bat now.

pause