tags:

views:

697

answers:

1

I need to change the physical path of a web site through the command line via the appcmd.exe tool, but I can't figure out the syntax. Can someone help?

A: 

This is how you should do:

C:\Windows\System32\inetsrv>appcmd set vdir "MySite/" -physicalPath:"C:\inetpub\temp"

Note: "MySite/" is a name of your virtual directory so if your virtual directory is under default web site you're likely have to set "Default Web Site/MySite/"


As for figuring out how to do other appcmd commands just type: appcmd set vdir /?

and you'll get all the info on what you can do to set your virtual directory.

Even more specifically, if you want to know what settings you can change for the specific virtual directory type:appcmd set vdir "MySite/" /?

These examples are just for virtual directory by they apply to other appcmd commands

Hope this helps

This did not answer the question. As stated, I need to change the physical path of a web site, not a virtual directory. Also, the question was that I cannot figure out the syntax. I'm aware of /?. The help outputted with that does not clearly describe how the syntax should look.
Frank Edwards
@Frank Edwards - 1. I assume you haven't tested my answer 2. In IIS 7.0, each *site* must have an application and each application must have a *virtual directory*. The root virtual directory of your site points to the physical path of the site. To better understand the concept of site / application / virtual directory I suggest reading this article: http://learn.iis.net/page.aspx/150/understanding-sites-applications-and-virtual-directories-in-iis-70/ especially the section with the title *IIS 7.0 Configuration: <sites> Section*