views:

1951

answers:

3

How can I rename a virtual directory (i.e. change the Virtual Path name) in IIS7 on Windows Server 2008?

In Server Manager I click on the application, select Basic Settings, but the box showing the current Alias is greyed out and I can't edit it.

Thanks.

A: 

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

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

Cloud
Looks like you're right. No-one else has got any suggestions on doing this via the UI so I guess it's not possible. Still don't know why though.
njreed.myopenid.com
A: 

You may want to checkout this post here

From adilei...

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

It shouldn't be any more complicated then VBScript.

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

and from jwmiller5...

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

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

Cheesy
Thanks; I'd already seen the other post. I'm trying to do this via the UI. I don't want to do it programatically. I can't figure out why the box is greyed out. I can't think of any logical reason why I shouldn't be able to rename an application to make it available under a different URL.
njreed.myopenid.com
+2  A: 

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

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

More details, including how to rename applications here: http://lanitdev.wordpress.com/2010/09/02/rename-applications-and-virtual-directories-in-iis7/

Brian Grinstead

related questions