# Get directory listing in IIS when default document exists

How do i get directory listing on IIS when default.aspx exists in that directory

-
sounds like you're trying to 'hack' something... –  cpbills May 18 '10 at 20:16

For IIS 6, you will need to enable Directory Browsing and remove all document's from Document tab.

For IIS 7, you will need to add the following in the web.config file under the parent directory i.e. `C:\inetpub\wwwroot`

``````<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="true" />
<defaultDocument enabled="false" />
</system.webServer>
</configuration>
``````
-

If you are using IIS 6.0, remove "default.aspx" from the listings in the "Documents" tab. Make sure that "Directory Browsing" is checked in the Home Directory tab.

If it is IIS 7.0, let me know and I'll look up the settings there.

-