Configure the Information to Display in a Directory Listing in IIS 7
Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista
After you enable directory browsing, you can select the information to display in a directory listing page when client browsers make requests without specifying a document name.
For information about the levels at which you can perform this procedure, and the modules, handlers, and permissions that are required to perform this procedure, see Directory Browsing Feature Requirements in IIS 7.
Exceptions to feature requirements
You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.
Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).
In Features View, double-click Directory Browsing.
On the Directory Browsing page, select or click to clear the following check boxes based on your preferences:
Time to display the last modified time for each file.
Size to display the size of each file.
Extension to display the extension with the file.
Date to display the last modified date for each file.
Long date to display the last modified date for each file in extended format.
- Time to display the last modified time for each file.
Click Apply in the Actions pane.
To specify the information to display in a directory listing, use the following syntax:
appcmd set config /section:directoryBrowse /showFlags:Time|Size|Extension|Date|LongDate|None
You can specify one or more of the values for the showFlags attribute, or you can specify None if you want only the file names and directory names to be displayed in a directory listing. If you want more than one value, separate each value with a comma (,). For example, to display the file name extension and date in long date format, type the following at the command prompt, and then press ENTER:
appcmd set config /section:directoryBrowse /showFlags:Extension,LongDate
For more information about Appcmd.exe see Appcmd.exe (IIS 7).
The procedure in this topic affects the following configuration elements:
For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.
Use the following WMI classes, methods, or properties to perform this procedure:
For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.