How do I change the physical path of web site in IIS7 with APPCMD?

后端 未结 5 1112
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 03:24

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?

5条回答
  •  孤城傲影
    2021-01-31 03:50

    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

提交回复
热议问题