Monday, January 26, 2009

junction.exe - Making my temporary laptop setup livable

I've written about junction.exe before - a super small tool that allows you to setup the equivalent of symbol links on Windows. What makes junction so cool is that the linked directories look and behave just like the source, whereas a Windows Shortcut is actually a file with link information in it.

This morning, Fedex came by to pickup my laptop, send it off to the repair depot. This left me with a temporary laptop and my current laptop's hard drive plugged in using a USB cable. Technically, the setup works just fine - but having all my files under F:\ has made it painful to access them. My fingers are just too used to typing the usual paths.

Not only that, but I've got content and programs on my new hard drive that the temporary laptop is missing. I was faced with having to resetup the MySQL databases that I had sitting already configured on my laptop hard drive. This was not a fun prospect (OK, it wasn't that bad - all the data was there, but I had better things to do than shuffle around files).

Enter junction.exe! I was able to create a few strategic links, like:

  junction.exe c:\tools f:\tools
  junction.exe c:\Documents and Settings\Ben\files f:\Users\ben\files

And bam!, the files appeared to be on C:\, yet were on the F:\ drive. This includes things like the database files I mentioned above. The result: I was able to run a MySQL instance right off the old drive, and use the existing files that were in place.

Not only didn't I need to take the time to worry about setting up a new environment, but, now I don't have to worry about the two environments getting out of sync.

Now, I realize this is nothing special for the Linux and Mac OS world. But, for us Windows people, being able to fake a directory layout like this and have Windows, Cygwin and any other tool be oblivious to it, is just too cool.

Why junctions aren't more popular on Windows is beyond me. Seems like they are a power user's dream.

2 comments:

  1. They would be more popular except most windows users dont even know they exist unless they have had some experience with linux.

    In Win2k and WinXP they can have some nasty side effects like if you delete the link from explorer it will actually delete all of the files in the link target not just the link, theres a bunch of other problems as well. Vista actually has proper symbolic links and the entire OS is aware of them, so the aforementioned problem does not happen, however old windows software can still be confused, but this should be less of a problem with time.

    ReplyDelete
  2. Hmmm.... Very interesting

    ReplyDelete