37

I've just installed IIS Express, can anyone tell me where it gets the settings for the following variables?

%IIS_BIN%
%IIS_USER_HOME%
%IIS_SITES_HOME%
%SYSTEMDRIVE%

Thanks

StuffandBlah
  • 1,047
  • 4
  • 13
  • 22
  • I feel like no one really searched yet about how to do that. I wonder if this behavior of selecting My Documents is just hard coded in IIS. By the way, is this really a StackOverflow question? – Léon Pelletier Dec 17 '14 at 14:54

3 Answers3

34

The following three environment variables are set by iisexpress.exe during the process startup.

  • %IIS_BIN% - refers to IIS Express installation folder (%PROGRAMFILES%\IIS Express)
  • %IIS_USER_HOME% - %USERPROFILE%\Documents\IISExpress
  • %IIS_SITES_HOME% - %USERPROFILE%\Documents\My Web Sites

%SYSTEMDRIVE% - is a standard windows system environment variable

Appulus
  • 18,630
  • 11
  • 38
  • 46
vikomall
  • 17,379
  • 6
  • 49
  • 39
  • 4
    So if I want to override these values how would I go about it? – StuffandBlah Feb 01 '11 at 08:24
  • To change IIS_USER_HOME, IIS_SITES_HOME path, redirect 'My Documents' folder to your path of interest. For example if you redirect my docouments folder to c:\temp, then your IIS_USER_HOME, IIS_SITES_HOME become 'c:\temp\iisexpress', 'c:\temp\my web sites' respectively. You cannot override/change IIS_BIN,SYSTEMDRIVE – vikomall Feb 01 '11 at 17:20
  • 6
    *@user578913*: -0.5. I don't want to discredit you in any way, but the information in your answer would be even more credible if you could back it up with an official source. I'm saying this because I found at least one error in it: `%IIS_BIN%` does *not* point to the installation folder, but to the folder of the currently executing instance of `iisexpress.exe`. (I know this through some quick experiments.) This may seem like nitpicking, but becomes important once you start having multiple copies of IIS Express, e.g. in several solutions. – stakx - no longer contributing Feb 06 '11 at 17:34
  • Thanks for correction. I was assuming that by default user runs it from the installation folder. – vikomall Feb 09 '11 at 17:39
2

To "change" the paths for the %IIS_USER_HOME% and %IIS_SITES_HOME% values, please see my explanation here.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Matty J
  • 3,116
  • 32
  • 31
-1
%IIS_USER_HOME% - The IIS Express home directory for the user
%IIS_SITES_HOME% - The default home directory for sites
%IIS_BIN% - The location of the IIS Express binaries
%SYSTEMDRIVE% - The drive letter of %IIS_BIN%
Erçin Dedeoğlu
  • 4,950
  • 4
  • 49
  • 69