PowerShell script to create symbolically linked (mklink) copies of WoW
There have been a couple of threads about creating copies of WoW using NTFS smybolic links (Vista mklink command). This approach has advantages over creating separate physical copies:
- Reduced disk activity since the OS only loads the physical files once
- Easier patching since only one physical copy of WoW needs to be patched
- Easier add-on maintenance since all clones share the parent add-on directory
- Why waste disk space if you don't have to?
I found it kind of a pain and very error-prone (at least for me) to manually type the commands for 5x copies of WoW when I was setting up, so I wrote a PowerShell script to do it automatically. It creates links for all of the WoW binaries and all of the read-only data directories. It does not link the WTF directory (video settings, saved variables, macros, etc.) to avoid collisions between settings on different accounts. I tried linking invidiaul files within this directory, but I found it to be more trouble than it was worth.
http://code.google.com/p/wow5box/sou...ts/New-Wow.ps1
The file below should be saved locally as "New-Wow.ps1". Instructions are in the script header.
If you get an error about the source directory not existing try using the -sourcePath parameter to specify your WoW directory.
If you get an error "The term 'cmd' is not recognized as a cmdlet, function, operable program or a script file..." make sure that c:\windows\system32 is in your path. (Environment variable PATH in Control Panel->System and Maintenance->System->Advanced System Settings->Environment Variables.)
One word of caution: Be careful if you *delete* a folder containing a symlinked sub-directory through Windows Explorer. On one occasion I somehow managed to delete the contents of the linked directories (all of my addons, etc.) by deleting a clone root directory. That's obviously a bug -- the links should be deleted, not the directories they point to -- and I haven't been able to reproduce it since. Still I have taken to deleting the linked directories individually (c:\wow1\Cache, c:\wow1\Data, etc.) rather than the root (c:\wow1) just to be safe.
[4/4/08 - Updated version w/ minor fixes]
[2/25/09 - Updated post w/ issues from thread below]
[2/11/10 - Link to latest version on google code site]