Geeks With Blogs
AngelEyes on .Net Tips, tricks and WTFs about Asp .Net, SQL Server and the likes.

from http://lanitdev.wordpress.com/2010/09/02/rename-applications-and-virtual-directories-in-iis7/

 

Rename Applications and Virtual Directories in IIS7

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

  1. Open a command prompt to see all of your applications.
    1 C:> %systemroot%\system32\inetsrv\appcmd list app
    2  
    3     APP "Default Web Site/OldApplicationName"
    4     APP "Default Web Site/AnotherApplication"
  2. 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
    2  
    3     APP object "Default Web Site/OldApplicationName" changed

Renaming Virtual Directories In IIS7

  1. Open a command prompt to see all of your virtual directories.
    1 C:> %systemroot%\system32\inetsrv\appcmd list vdir
    2  
    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
    2  
    3     VDIR object "Default Web Site/OldApplicationName/Images" changed
    4  
    5 C:> %systemroot%\system32\inetsrv\appcmd set vdir "Default Web Site/OldApplicationName/Data/Config" -path:/Data/Config2
    6  
    7     VDIR object "Default Web Site/OldApplicationName/Data/Config" changed
Posted on Sunday, December 5, 2010 4:47 PM | Back to top


Comments on this post: Rename Applications and Virtual Directories in IIS7

# re: Rename Applications and Virtual Directories in IIS7
Requesting Gravatar...
Thanks, that was a very good tutorial.
keep up the good work.
Left by הפקת אירועים on Feb 20, 2011 1:16 AM

# re: Rename Applications and Virtual Directories in IIS7
Requesting Gravatar...
appcmd list appcmd = syntax error
+ other lines also don't work

Please copy/paste your commands in to see they do not work then fix them or remove this publication so it doesn't waste other peoples time as it has done mine
Left by james blunt on May 06, 2011 1:37 PM

# re: Rename Applications and Virtual Directories in IIS7
Requesting Gravatar...
Thank you James. I've changed it in the post - the command for listing virtual directories is
appcmd list vdir
Left by Angel Eyes on May 07, 2011 9:05 AM

# re: Rename Applications and Virtual Directories in IIS7
Requesting Gravatar...
i have problems too in the virtual directories. I can not connet to them
Left by cem on Jun 01, 2011 1:45 PM

# @cem
Requesting Gravatar...
What do you mean?
Left by AngelEyes on Jun 01, 2011 2:03 PM

# re: Rename Applications and Virtual Directories in IIS7
Requesting Gravatar...
good work. thanks
Left by nice guy on Jan 16, 2014 5:58 AM

# re: Rename Applications and Virtual Directories in IIS7
Requesting Gravatar...
Commands work as shown. Be sure to put complete descriptor for the object as noted - no shorthands.
Left by Allen on Oct 01, 2014 2:53 PM

Your comment:
 (will show your gravatar)


Copyright © AngelEyes | Powered by: GeeksWithBlogs.net | Join free