6

Is there a way to get a list of Virtual directories under a specific website in IIS using the command prompt?

I was able to perform the task using C# but I have a specific requirement where-in I need to list all the virtual directories under a website using the command prompt.

Rich
  • 5,603
  • 9
  • 39
  • 61
  • 1
    Can you use PowerShell or VbScript? You can easily query the WMI provider with either of those. I'm not sure off the top of my head with the cmd prompt. – codemonkeh Oct 17 '13 at 06:31
  • @codemonkeh You could write an answer for one or both anyway. Both kinds of script can be invoked from a command prompt. – anton.burger Oct 17 '13 at 07:47
  • possible duplicate of [DOS command to list all virtual directories in IIS 6](http://stackoverflow.com/questions/13218046/dos-command-to-list-all-virtual-directories-in-iis-6) – codemonkeh Oct 17 '13 at 21:53
  • Another possible solution for you: http://stackoverflow.com/questions/3938467/list-all-virtual-directories-in-iis-5-6-and-7 – codemonkeh Oct 17 '13 at 21:54

1 Answers1

5
appcmd list vdir /app.name:[sitename]/

Replace [sitename] with the name of your site.

For more info, check out Microsoft Technet.

Michael
  • 8,362
  • 6
  • 61
  • 88
JWL_
  • 829
  • 5
  • 15