[ACCEPTED]-Rename virtual directory on Windows Server 2008 (IIS7 )-windows-server-2008

Accepted answer
Score: 62

I found a way to do this using the built 5 in appcmd.exe tool. If you wanted to change 4 your virtual directory "Images" inside 3 your application "OldApplicationName" type 2 this into the command line.

%systemroot%\system32\inetsrv\appcmd set vdir "Default Web Site/OldApplicationName/Images" -path:/Images2

More details, including 1 how to rename applications here: http://www.foliotek.com/devblog/rename-applications-and-virtual-directories-in-iis7/

Score: 12

For as far as I know, there is no way to 6 do it. You can only delete the virtual directory, and 5 recreate it with the same settings.

Or at 4 least, you can't do it through the GUI. There 3 might be ways to do it through scripting 2 in PowerShell for example. But I don't know 1 how.

Score: 7

If you are also trying to rename the app, the 2 context is almost the same except using 1 "set app" instead of "set vdir"

appcmd set app "Default Web Site/OriginalSite" -path:/RenamedSite
Score: 1

You may want to checkout this post here

From 16 adilei...

Try PowerShell, I think IIS7 has introduced 15 new administration tools that look quite 14 powerful. I think you could also use these 13 scripts to manage IIS remotely via WMI.

It 12 shouldn't be any more complicated then 11 VBScript.

Another way would be to use VBScript to 10 edit the IIS configuration files or create 9 an administration object, but that doesn't 8 really seem to be the way to go about 7 it.

and from jwmiller5...

Do you want to rename 6 it in IIS, or change the virtual path? adsutil 5 can do either. It should be installed 4 in c:\inetpub\AdminScripts

adsutil.vbs 3 SET W3SVC/svcnum/Root/AppName/AppFriendlyName "New 2 Friendly Name" adsutil.vbs SET W3SVC/svcnum/Root/AppName/AppRoot 1 "New Application Path"

More Related questions