mklink – symbolic links for windows

I found this feature the other day and it’s made my life easier. When compiling GMod the source is in a folder called src, and the generated binaries go in a folder next to src called game. To test it out I had a script that copied the binaries from game to sourcemods. That way I can run the development version of Garry’s Mod as a Mod on Steam.

Well with mklink I can create a link between game and sourcemods. So that when I open the sourcemods folder it’s identical to the game folder. It’s the same folder under a different name. The OS treats it exactly as if the files were in sourcemods.

The command line is pretty straight forward..

mklink /D /J [TARGET FOLDER] [SOURCE FOLDER]

For example I have a .bat file in my source 

with the contents:

rmdir D:gamessteamsteamappssourcemods
mklink /D /J D:gamessteamsteamappssourcemods game 

I have that file in both my garry’s mod branch and my garry’s mod beta branch – so I can easily switch between them.

Thought this was a cool feature that someone might want to know about.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s