Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display the physical path of a web application using appcmd.exe?

Please, observe:

PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop> $a
C:\Program Files\IIS Express\appcmd.exe
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop> &$a list app "MyDayforce/" /text:*
APP
  path:"/"
  APP.NAME:"MyDayforce/"
  APPPOOL.NAME:"Clr4IntegratedAppPool"
  SITE.NAME:"MyDayforce"
  [application]
    path:"/"
    applicationPool:"Clr4IntegratedAppPool"
    enabledProtocols:"http"
    serviceAutoStartEnabled:"false"
    serviceAutoStartProvider:""
    preloadEnabled:"false"
    [virtualDirectoryDefaults]
      path:""
      physicalPath:""
      userName:""
      password:""
      logonMethod:"ClearText"
      allowSubDirConfig:"true"
    [virtualDirectory]
      path:"/"
      physicalPath:"C:\Dayforce\SharpTop\UI\MyWORKBits"
      userName:""
      password:""
      logonMethod:"ClearText"
      allowSubDirConfig:"true"
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop> &$a list app "MyDayforce/" /text:applicationPool
Clr4IntegratedAppPool
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop> &$a list app "MyDayforce/" /text:enabledProtocols
http
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop>

I have no idea how to display the value of physicalPath. Tried all kinds of variants - nothing works.

So, how do I fetch the physicalPath from the app object ?

P.S.

I know how to do it from the vdir object:

PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop> &$a list vdir /app.name:"MyDayforce/" /text:physicalPath
C:\Dayforce\SharpTop\UI\MyWORKBits
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop>

But I have a specific interest in the app object in order to understand whether nested properties can be fetched using the /text flag.

like image 322
mark Avatar asked Oct 25 '25 20:10

mark


1 Answers

Good afternoon mark!

To display the physical path using only the app object you can reference it using the [path='string'] syntax. Using this you can reference all of the properties of the nested VirtualDirectory object.

So for your example you would use the following command: &$a list app "MyDayforce/" /text:[path='/'].physicalPath

Or more generally for default IIS installations

C:\Windows\system32\inetsrv\appcmd.exe list app "Default Web Site/" /text:[path='/'].physicalPath

like image 131
Brian Gilreath Avatar answered Oct 29 '25 00:10

Brian Gilreath



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!