Wednesday, February 27, 2013

Symbolic links in Windows 7

This is just a quick note on how to create symbolic directory links in Windows 7. I like to use this for development languages/frameworks (e.g. groovy, grails) so that I can easily change the version of the language that I'm using. For example, I'll have the following setup C:\dev\lang\groovy C:\dev\lang\groovy\groovy-2.0.0 C:\dev\lang\groovy\groovy-2.1.1 C:\dev\lang\groovy\groovy-latest Where groovy-latest is a symlink to the version of groovy I want to use. I found the full directions on how to create a symbolic link in Windows here: http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/ Here is the quick version using my above example. The command for making symlinks is called "mklink":
cd c:\dev\lang\groovy
mklink /D  groovy-latest groovy-2.1.1
The /D flag indicates this is a directory link. If the link exists already you have to remove it first:
cd c:\dev\lang\groovy
rmdir groovy-latest
mklink /D  groovy-latest groovy-2.1.1

No comments:

Post a Comment