1

How can I use appcmd in IIS7 to set the physical path of a website?

Something like...

appcmd set site summit /[path='/'].path:c:\newpath
John Livermore
  • 303
  • 1
  • 3
  • 8

1 Answers1

1

Try something like:

appcmd.exe set config  -section:system.applicationHost/sites /[name='My Site'].[path='/'].[path='/'].physicalPath:"c:\newpath"  /commit:apphost
Peter Hahndorf
  • 14,058
  • 3
  • 41
  • 58
  • Thanks. This worked for me... appcmd set site /site.name:"site name" /application[path='/'].virtualDirectory[path='/'].physicalPath:"D:\newpath". Yours might work as well! – John Livermore Feb 21 '20 at 22:56
  • @JohnLivermore you should accept the answer to close the discussion. – Lex Li Feb 25 '20 at 17:19