How to move mods, maps, etc. out of the Local Settings folder

http://www.sitepoint.com/newsletter/viewissue.php?id=3&issue=62&format=html#4
WARNING: The following is for users with administrator accounts, knowledge of how Windows works, and the ability to find solutions to computer problems.

How to move mods, maps, and other content out of the \Local Settings\Application Data folders. Last update on 3/13.

I would like to thank Ironclad/Stardock for their support and for creating Sins. I would also like to thank forum users Damicatz and Radtoo for helping point me in the right direction.

The working solution I've found is to use the NTFS feature of junction points, which now seem to work like symbolic links in other operating systems (mainly Linux). This has been tested by myself on my main computer's Windows XP Pro SP2 and ran flawlessly with slightly increased loading times when a mod is loaded (2 to 5 second increase). This is not guaranteed to work for you or on any other operating system such as Vista or Windows 2000. However, it should work on Windows XP Home or Pro, both SP2. In the early days of Windows XP, these features of NTFS were dodgy at best. It seems Microsoft has come a long way since then and either SP1 or SP2 polished up the junction point feature. Make sure you are an advanced user before attempting what's below because you do so at your own risk.

A junction point or symbolic link lets you define a file, folder, or drive to be like a pointer that goes somewhere else on your system. When you browse to that pointer you're seamlessly redirected to some other place on your system be it a different file, folder, or drive. It's all redirection, pure and simple.

To start, you'll need to download a program called Junction. You can get it from these locations:

http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx

Once you download this program, you'll want to extract its exe file and place the junction.exe program into the C:\Windows directory. The EULA you can do whatever you want with. By placing it in the windows directory this will simplify accessing the junction commands. To use junction, do the following:

1) Use windows explorer to create a new folder where you want your mods to go. I placed mine in E:\Program Files\Stardock Games\Sins of a Solar Empire\ModsRedirect on my external E drive. If you place the folder in one of the game data directories, install directories, or in the My Games folder, be sure to give the folder you're creating a name that Ironclad probably won't choose should they change the game's file structure. In my example, I created the ModsRedirect folder just incase Ironclad were to create a Mods or ModsAlternate in the game install directory. You'll want to move your mods there now and clear out the old directory you're about to turn into a pointer.

2) Go to Start > Run > and type CMD . This will bring up a command prompt. Now type cd c:\ to get to your C drive and out of the Documents and Settings folder. There's a bunch of ways of doing this, but as long as you see C:\> now you're just fine.

3) Type junction. You can also type junction.exe but windows will recognize junction to be junction.exe and automatically run the appropriate program. You will get a license agreement screen and some text output describing how to use this program. It will not display this text output a second time. If you don't remember the original text, then here it is. You'll want to reference this because it tells you how to create junctions and delete them too:

Junction v1.05 - Windows junction creator and reparse point viewer
Copyright (C) 2000-2007 Mark Russinovich
Systems Internals - http://www.sysinternals.com

The first usage is for displaying reparse point information, and the
second usage is for creating or deleting a NTFS junction point:

usage: junction [-s] [-q]
-q Don't print error messages (quiet)

-s Recurse subdirectories

usage: junction [-d]
-d Delete the specified junction
example: junction d:\link c:\winnt

4) Now the fun part. You're going to create the actual junction point. The command is:

junction
C:\>junction -d "C:\Documents and Settings\ZJBDragon\Local Settings\Application Data\Ironclad Games\Sins of a Solar Empire\Mods" "E:\Program Files\Stardock Games\Sins of a Solar Empire\ModsRedirect"
11,716 views 11 replies
Reply #1 Top
Interesting. I was looking at something like this myself, but didn't pursue it. I had come upon Junction points during my search, but didn't use it. I will have to consider this way as opposed to the other method I used.

Nicely done.
Reply #2 Top
Nice job. I'll have to try this. And I completely understand this because it's the way "shortcuts" and "pointers" work in the document management system I support that uses Oracle as it's back end.
Reply #3 Top
Excellent!
That solves the space problems and the query about moving the Mods folder that I posted about several weeks ago!!
Reply #4 Top
Tried it last night, not just on my Mods folder, but on the saves and replay folders for single player.

Works in all my attempts and saves so far.


I decided to go with this solution instead of the registry editing solution I had. Thanks again, ZJBDragon.
Reply #5 Top
Thanks for the comments. :)

I'm so glad this works. I didn't get a stop error/blue screen either today when I disconnected the drive I set that junction with (I had expected to get that due to experiences years ago with NTFS's implementation of these junctions AKA symbolic links). As far as I can tell, everything is working exactly the way it should, which is very nice. None of my games have even realized I put their memory-eating junk where it belongs in/near their own install directories.
Reply #6 Top
Good stuff. For anyone who might be using Vista (oh, the whole 2 or 3 of us), the same junction feature is available natively and no download is needed. All of ZJBDragon's other disclaimers and warnings still apply.

1. Follow ZJBDragon's Step 1 and move your mods directory somewhere else. In Vista, the original mods directory is located at C:\Users\your_user_name\AppData\Local\Ironclad Games\Sins of a Solar Empire\Mods.

2. Open up a command prompt (Start -> Run -> cmd).

3. Use the mklink command to make a junction:
mklink /j "C:\Users\your_user_name\AppData\Local\Ironclad Games\Sins of a Solar Empire\Mods" "C:\path_to_your_ModsRedirect_folder"

That's it.

If you want to remove the junction in the future, just delete the C:\Users\your_user_name\AppData\Local\Ironclad Games\Sins of a Solar Empire\Mods directory in Windows Explorer (the icon should look like a folder shortcut, with a little arrow in one corner) and restore your ModsRedirect folder to the original Mods location.
Reply #7 Top
Thanks - looks like a tidy solution. Regardless of whether the developers need to adhere to this for Microsoft's happiness, I can't stand having game data files on my Windows drive.

It's too bad there's not a GUI to easily manage all the links. Then I would feel comfortable about redirecting all of my games that love to save stuff on the C partition.

-HM
Reply #8 Top
Thanks for this info, this is exactly what I needed. So far seems to be working fine.
I've set the redirect for the entire directory for Sins at this stage.
Have been able to load old games, save games, etc. Seems to be fine at this stage....

That'll teach me for deciding 3 years ago that I should partition an OS drive of 10GB for Windows XP.
With 700MB free space now after various programs have decided they must absolutely install on C Drive, I was worried when I saw Sins doing the same. Gotta love M$.
Reply #9 Top
Hollow Man
Thanks - looks like a tidy solution. Regardless of whether the developers need to adhere to this for Microsoft's happiness, I can't stand having game data files on my Windows drive.It's too bad there's not a GUI to easily manage all the links. Then I would feel comfortable about redirecting all of my games that love to save stuff on the C partition.-HM
End of quote
That would be nice, but I was kind of having fun giving Windows actual important commands through a command prompt. :p It was refreshing since back in college we used Unix and Linux for everything and nearly all work with the machines running those OS's was done remotely.

AussieEngineer
Thanks for this info, this is exactly what I needed. So far seems to be working fine.I've set the redirect for the entire directory for Sins at this stage.Have been able to load old games, save games, etc. Seems to be fine at this stage....That'll teach me for deciding 3 years ago that I should partition an OS drive of 10GB for Windows XP.With 700MB free space now after various programs have decided they must absolutely install on C Drive, I was worried when I saw Sins doing the same. Gotta love M$.
End of quote
There are utilities out there that can merge those partitions. I'm not sure what sort of effect that would have on programs though.

And yeah, I too love it how they change direction without letting anyone know. I remember years ago when it was a good idea to stick Windows in its own little playpen since it was always getting itself into trouble. Windows has improved, but it still tends to "gain weight" in various forms and pick up unwanted intruders from time to time depending on who is running it. Besides, keeping things off of the Windows drive was previously viewed as a good way to boost performance and read/write times...
Reply #10 Top
I don't necessarily mind using a command line (I've had a PC since 1983, plus use Linux), but it doesn't look like this program allows one to list all the junctions. I could see me creating a bunch then forgetting what I did!

-HM
Reply #11 Top

Thanks very much for this.

I was wondering where all the space on my windows install partition was going. I don't install software there for a reason.

I am restraining myself from ranting.

Just thanks.

dM