I am running JetBrains Idea IntelliJ on Windows XP. How does the $MODULE_DIR$ variable in the IntelliJ "*.iml" file get set? It seems to contain a root directory for the modules or project, but I don't see how it gets set. There is no setting that you can access from the file/settings menu. I have "grepped" through the intellij installation and through my project directory for it, and I don't see where it gets set. It is not an environment variable. It is not in the Registry. It seems to change its value based on the last location of an IntelliJ project I recently used.