Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know if it's possible to use a folder shortcut as an enviroment variable element.

I'm using a specific folder layout to organize my programming libraries, similar to the OSX Frameworks layout:

Library root ->  
   Versions ->  
      1.0 ->  
      2.0 ->  
   Include (shortcut to one of the Includes in Versions)  
   Lib (shortcut to one of the Lib ins Versions)

This way I can specify a default version, but I'm also able to use any other versions.
My problem is that Visual Studio doesn't link my projects if I use the shortcuts for the LIB environment variable, but it works if I use the original folder.

share|improve this question
I don't understand this question. Please edit your question to explain what you want a little more clearly. Perhaps with an example of what you want to achieve. – Nifle Sep 24 '11 at 16:27
Hmm, are you perhaps looking for something like LD_LIBRARY_PATH or LIBPATH for windows? – Nifle Sep 24 '11 at 16:30
@Nifle: My problem was about using folder shortcuts (an Explorer feature) in a environment variable (I use the LIB variable for D language libraries). The solution is using a symlink or junction instead of a folder shortcut (check grawity's answer). – ludovic.silvestre Sep 26 '11 at 12:08
up vote 3 down vote accepted

Your problem is that shortcuts are not a system-wide feature – they get special treatment only inside the Explorer shell. Usage "in environment variables" is irrelevant here.

Instead of shortcuts, you can use junctions or symlinks through mklink – both work at filesystem level and will be supported by all programs.

share|improve this answer
A folder shortcut, AKA Hardlink, AKA junction. If I wasn't out of 24hr votes, I'd vote this. . Gotta bookmark for later. – surfasb Sep 24 '11 at 18:42
@surfasb: Except folder shortcuts are not hardlinks, which are not symlinks, which are not junctions. They are four separate functions. – grawity Sep 24 '11 at 18:46
Ack, I was thinking a (common noun) shortcut to a folder, not (proper noun)Shortcut to a folder. – surfasb Sep 24 '11 at 18:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.