Have you ever wondered why the box to change the name or “Alias” on an application or virtual directory is greyed out (see screenshot below)? I found a way to change the name without recreating all your settings. It uses the built in administration commands in IIS7, called appcmd.

Renaming Applications In IIS7
- Open a command prompt to see all of your applications.
1 |
C:> %systemroot%\system32\inetsrv\appcmd list app |
3 |
APP "Default Web Site/OldApplicationName" |
4 |
APP "Default Web Site/AnotherApplication" |
- Run a command like this to change your “OldApplicationName” path to “NewApplicationName”. Now you can use http://localhost/newapplicationname
1 |
C:> %systemroot%\system32\inetsrv\appcmd set app "Default Web Site/OldApplicationName" -path:/NewApplicationName |
3 |
APP object "Default Web Site/OldApplicationName" changed |
Renaming Virtual Directories In IIS7
- Open a command prompt to see all of your virtual directories.
1 |
C:> %systemroot%\system32\inetsrv\appcmd list vdir |
3 |
VDIR "Default Web Site/OldApplicationName/Images" (physicalPath:\\server\images) |
4 |
VDIR "Default Web Site/OldApplicationName/Data/Config" (physicalPath:\\server\config) |
We want to rename /Images to /Images2 and /Data/Config to /Data/Config2. Here are the example commands:
1 |
C:> %systemroot%\system32\inetsrv\appcmd set vdir "Default Web Site/OldApplicationName/Images" -path:/Images2 |
3 |
VDIR object "Default Web Site/OldApplicationName/Images" changed |
5 |
C:> %systemroot%\system32\inetsrv\appcmd set vdir "Default Web Site/OldApplicationName/Data/Config" -path:/Data/Config2 |
7 |
VDIR object "Default Web Site/OldApplicationName/Data/Config" changed |