0

we want get current physicalPath of the site using appcmd.exe.

how to identify physicalPath of site via site name or app pool name.

User12
  • 69
  • 1
  • 7
  • Any reason you are not using PowerShell for this kind of stuff? Much easier. – Peter Hahndorf May 16 '21 at 19:02
  • @PeterHahndorf i want showing result in a table of the sites with directory in webpage. – User12 May 17 '21 at 10:32
  • in PowerShell you could do something like `Get-ChildItem IIS:\Sites\ | Select Name, physicalPath | ConvertTo-Html -Title "My sites" | Set-Content -Path C:\inetpub\wwwroot\sites.html` – Peter Hahndorf May 17 '21 at 21:17

1 Answers1

0

i was able to solve the problem with the following command:

%systemroot%\system32\inetsrv\AppCmd.exe list app /site.name:"example.com" /path:"/" /xml | %systemroot%\system32\inetsrv\AppCmd.exe list vdir /in /text:physicalPath
User12
  • 69
  • 1
  • 7